Multiple lines of text box post, how to identify it.

Source: Internet
Author: User
This is the modified data, multi-line, multi-column.

The text box inside how to design ah.

Each line has a name of the text box, how can I name him better, when I save, how to know is to save which row.

If I define the name text box, the name is, xingming, obviously there are multiple lines of name text box name is xingming, this is not a conflict ah. Psot can't identify which is which. It's kinda tangled.

Have a friend done it, give a plan. More Tangled.


Reply to discussion (solution)

Don't you have a saved button on each back? It's a click event, and then you add a suffix to that, and that's xingming1 xingming2.

Don't you have a saved button on each back? It's a click event, and then you add a suffix to that, and that's xingming1 xingming2.

This line, how do I know, when submitted, I clicked on which row of the Save button was submitted.

Use a single form per line

All parameters of each row are distinguished by the ID of the data or the unique field

Use a single form per line

It's a bit of a waste. If there are 100 lines, do I use 100 forms?

All parameters of each row are distinguished by the ID of the data or the unique field

Exactly how to do it, a little dizzy.

Now that you have a submit button on each line, where is a single form of each line wasted?

A 100-row form is a waste if it commits a single row of data?

A 100-row form is a waste if it commits a single row of data?


Oh! That's really the truth,

You first determine whether it is an Ajax commit or a form refresh commit

You use Ajax to submit, your data first field does not have an ID, you save the button to do a onclick=postdata ($id) event, the name, age, height of input name value: name_$id,age_$id,age_$ Weight, and then in the PostData function, according to the incoming $id parameter to obtain the value of 3 input, and then submit

It was written in a wrong place, and age_$weight should be weight_$id.

You first determine whether it is an Ajax commit or a form refresh commit

Ajax submissions, it's estimated that you're going to use that method. Multiple forms.

It seems like a form is OK. Pass a parameter to JS, in the JS inside in processing a bit, in commit.

Just lazy, with post refresh submitted. Use multiple forms. Ha ha

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.