I have a HTML form that contains text fields, checkboxes, radiobuttons and a submit button.
I'd like that submit button is enabled only if contents of fields are modified. Now here is the catch: if the user modifies field contents back to original values, the form button should be disabled again.
- Original field value "foo" => submit button is disabled
- User changes field value to "bar" => submit button becomes enabled
- User changes field value back to "foo" => submit button becomes disabled again
How to achieve this with jQuery? Are there any kind of general solution or script that I could use with any form?
Edit: What I am asking can't be done with simple dirty state tracking.