How do I click the button to update my data?

Source: Internet
Author: User
I want to click the "Updqte" button after the button becomes "save", then the cell becomes a text box, after editing the text box, click "Save" Results submitted to the database. Button change with JS finished, the other really is not back, you big God help it.

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >

Reply to discussion (solution)

1. Give your save button an OnClick method to trigger after clicking
2. Using AJAX to submit parameters to the background, invoking the PHP program
3. Then submit the received content to the database
4. Successful or failed to return to page

You're going to use Ajax to submit the data.

1. Give your save button an OnClick method to trigger after clicking
2. Using AJAX to submit parameters to the background, invoking the PHP program
3. Then submit the received content to the database
4. Successful or failed to return to page

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >

The red part of my table is an array, and I want to make the array dynamic, or else all the buttons will only manipulate one piece of data. Is there any good way?

1. Give your save button an OnClick method to trigger after clicking
2. Using AJAX to submit parameters to the background, invoking the PHP program
3. Then submit the received content to the database
4. Successful or failed to return to page
Sorry is the 24th line, just didn't mark the color.

If I do, it's all set to be hidden.
A. Show ()
A. Hide ()
Trigger function to switch to another button when one operation is completed

It is recommended that the LZ select the JQ selector is very powerful
With Ajax enough to do a lot of input submission work

You're going to use Ajax to submit the data.

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >

The 24th line of the array can be changed to dynamic, or all the buttons are only the same data, how should be changed ah?


The code you just described is not very clear, you can refer to a test

xml/html Code
?
12345678910111213141516171819202122

Thank you, I didn't learn Ajax and JQ.

Items = Tds.join (', ');

That's a stubborn piece of paper.

function change (obj)          {       //can pass a current object over                 var tds = document.getElementsByTagName ("TD");                 var T1 = document.getElementById ("a"). InnerHTML;                 var txt = document.createelement ("input");                  Txt.type = "text";                  txt.value = T1;                 Txt.id = "sort_t";                  Obj.parentnode.childnodes[1].appendchild (TXT);       Added to the second TD, can modify                             txt.select () as needed;              }

When called,
Change (This)
And your ID name is duplicated, so you can only get the first one.

  • 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.