greentiger
Programmer
Hi,
I'm new to this forum and to javascript programming and hope someone can help me.
I have a page which reads values from a database using php and displays the results in a series of text input boxes so that users may edit one or more of them at random. The text input controls are within a form. On submission I want to post an array containing any values that have been changed together with the original values to the receiving page.
I think I need three javascript functions but don't have the 'know how' to implement them. The first two functions would be on events in the input boxes.
The first, an onFocus event which will temporaily save the original value of the text box before it is changed.
The second, an onChange event which is called after the data has been changed in a text box, this should then write the temp saved original value and the edited value to a array.
The third function would be an onSubmit function that would enable the array to be posted as form data to a recieving php page which will process the data and write revisions back to the database.
Any advice would be most welcome.
I'm new to this forum and to javascript programming and hope someone can help me.
I have a page which reads values from a database using php and displays the results in a series of text input boxes so that users may edit one or more of them at random. The text input controls are within a form. On submission I want to post an array containing any values that have been changed together with the original values to the receiving page.
I think I need three javascript functions but don't have the 'know how' to implement them. The first two functions would be on events in the input boxes.
The first, an onFocus event which will temporaily save the original value of the text box before it is changed.
The second, an onChange event which is called after the data has been changed in a text box, this should then write the temp saved original value and the edited value to a array.
The third function would be an onSubmit function that would enable the array to be posted as form data to a recieving php page which will process the data and write revisions back to the database.
Any advice would be most welcome.