specify elements of a form to clear using reset button

Is there a way to specify what elements of a form are cleared when using a standard reset button?  Can you specify by name what textboxes for example are cleared and the ones not specified will remain intact?
dale4brumbaughAsked:
Who is Participating?
 
kevp75Connect With a Mentor Commented:
put this in between the <head> tags, and make sure you modify it to your actual form name (if your form doesn't have one put it in), and the name of your form fields
<script language="Javascript">
function clearFields()
{
  document.TheNameOfYourForm.TheNameOfYourField.value = "";
}
</script>

then just copy/paste:   document.TheNameOfYourForm.TheNameOfYourField.value = "";

for each field you need cleared...making sure to change the names....

then at you submit button, put:
<input type="button" onclick="javascript:clearFields();" value="Clear" name="btnClear">
0
 
kevbreitCommented:
Not without javascript.  You can either blank out everything or reset everything to default states.
0
 
dale4brumbaughAuthor Commented:
exactly what i was looking for.  thank you
0
 
kevp75Commented:
any time
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.