I am using a form and was wondering if anyone knows some JavaScript that can edit what fields the clear button actually clears?
i.e i only want a select number of fields to be cleared once the user hits the clear button on the form.
input id='FrmReset' type='reset' value='Clear' name='resetButton' onclick='formReset(document.getElementById("Form")); return false;'
I just have the following which clears everything
<input id='FrmReset' type='reset' value='Clear' name='resetButton' onclick='formReset(document.getElementById("Form")); return false;' />
Let's say you have 4 fields like this:
And you need to clear only bottom 2. Add a normal button with onclick event:
As you can see - the function selectively picks only specific fields and resets their values.
Demo: http://jsfiddle.net/rdnT3/