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?
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 = "";

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">
Not without javascript.  You can either blank out everything or reset everything to default states.
dale4brumbaughAuthor Commented:
exactly what i was looking for.  thank you
any time
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.