I have a "Cancel" button on a form that when clicked brings the user back to the previous page where he had entered data into two different text boxes and also had to click a radion button. I can get the user back but can not space out the two text boxes and unchecked the radio buttons.
Here is the button
[HTML]<input type="button" onClick="histor y.go(-1);clearForm(); return true;" name="CancelBut ton" value="Cancel" class="button">
[/HTML]
And the function clearForm()
[CODE=javascript]function clearForm() {
document.all("m yForm").value = ""
//document.myForm .thetext.value = '';
//document.myForm .searchParm.val ue = '';
//document.getEle mentById("myFor m").reset();
//document.myForm .setthetext(" ");
//document.myForm .setCheckedValu e("none");
//document.getEle mentById("myFor m").reset();
//document.myForm .thetext.focus( );
}
[/CODE]Nothing works.
Here is the button
[HTML]<input type="button" onClick="histor y.go(-1);clearForm(); return true;" name="CancelBut ton" value="Cancel" class="button">
[/HTML]
And the function clearForm()
[CODE=javascript]function clearForm() {
document.all("m yForm").value = ""
//document.myForm .thetext.value = '';
//document.myForm .searchParm.val ue = '';
//document.getEle mentById("myFor m").reset();
//document.myForm .setthetext(" ");
//document.myForm .setCheckedValu e("none");
//document.getEle mentById("myFor m").reset();
//document.myForm .thetext.focus( );
}
[/CODE]Nothing works.
Comment