Hey,

I have the simple test form below. When I enter something into Sale Order field, hit the submit button. Once the submitted button is clicked, I click on Reset Form button to clear out all fields. However the code below did not working, but if I removed the <fieldset> form the form below then it clear out the value from the form. Can anyone please help?

Thanks

<script type="text/javascript">
function clearForm(oForm) {

var elements = oForm.elements;

oForm.reset();

for(i=0; i<elements.length; i++) {

field_type = elements[i].type.toLowerCase();

switch(field_type) {

case "text":
case "password":
case "textarea":
case "hidden":

elements[i].value = "";
break;

case "radio":
case "checkbox":
if (elements[i].checked) {
elements[i].checked = false;
}
break;

case "select-one":
case "select-multi":
elements[i].selectedIndex = -1;
break;

default:
break;
}
}
}

</script>

//FORM STARTS
<cfform action="##" method="post">
<fieldset>
<legend>Ital Search Form</legend>
<ol>
<li>
<label for="so">Sales Order Number</label>
<cfinput id="so" type="text" name="so" value="#form.so#" size="20" />
</li>
</ol>
</fieldset>
<cfinput type="submit" name="submit" class="button" value="Search"/>
<cfinput type="button" name="reset_form" value="Reset Form" onclick="clearForm(this.form);">
</cfform>