Entry
How to clear a form on a page refresh or reload without clear button in Netscape
Aug 11th, 2006 16:54
David Alden, Tony Vigliano,
<html>
<form name="thisForm">
<input type="text" name="thisText" value="this text
box">
<textarea name="thisTextarea" >Some sample
text</textarea>
<br>
<br>
<input type="button" value="Are there Text Boxes on
this page?">
</form>
<script type="text/javascript" language="javascript">
for(var i = 0; i < document.forms.length; i++){
for(var z = 0; z < document.forms[i].length; z++){
if(document.forms[i].elements[z].type!
="button")
document.forms[i].elements[z].value="";
}
}
</script>
</html>