Enable the submit button only if the value in the form has been changed

I have a php form for a website containing text fields displaying the values ​​retrieved from my database, as well as a submit button. I would like the submit button to be disabled by default and only available for clicks if the user has made changes to one of the text fields on the form. However, if they were to return it to its default value, the button will automatically be disabled. Any help is appreciated.

+1
button forms
Jan 18 '13 at 15:11
source share
2 answers

You need to use javascript. For each field, you must make an event handler that checks the value and then enables or disables the submit button.

0
Jan 18 '13 at 15:14
source share
  • Declare Variables for Each Text Box
  • Then assign the values ​​you retrieve from the database to the text box and variables ...
  • During Button_Click, compare the value of the text field with the variables
  • If BOTH are the same then EDIT does not occur

What all

0
Jan 18 '13 at 15:20
source share



All Articles