Can anyone give me a basic example of how to clear specific form inputs (each with it's own unique ID) when a checkbox is unchecked? I've tried a handful of solutions but just can't quite seem to get this working reliably. I need this to only happen when the box is unchecked, which seems to be giving me issues.
相关问题
- Laravel Option Select - Default Issue
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- HTML form is not sending $_POST values
- How to use Control.FromHandle?
A rough example might be...
In the checkbox's onClick(), investigate the checkbox's value, then perform whatever action you wish, including clearing the forms. Does this meet your need?
here is the working fiddle JSFiddle
Very simple example, to get you started. Uses jQuery 1.7.1. http://jsfiddle.net/fPKX8/
HTML:
jQuery: