I have a php form for a website containing text fields which display values retrieved from my database and also a submit button. I would like the submit button to be disabled by default and to only be clickable if the user has made a change to one of the text fields in the form. However if they were to change it back to the default value, the button would automatically be disabled again. Any help is appreciated.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You need to use javascript. For each field, you must make a eventhandler that checks the value and then enables or disables your submit-button.
回答2:
- Declare a Variables for each Text box
- Then assign the values that you Retrieving from database to the text box and a Variables...
- At the time of Button_Click compare the Value of text box with the Variables
- If BOTH are Same then there is no EDIT's occur
That's all