I have a search form with a myName textfield.
On load, the field in the form is set using session attribute.
Something like:
<% String nameValue = (String)session.getAttribute("nameValue"); %>
And below code where the text field is defined:
<form name="myForm" method="POST">
<input type="text" name="myName" id="myName" size="45" maxlength="49" value="<%=nameValue%>">
</form>
In the same form I have a reset field defined as below:
<input type="reset" value="Reset" id="Reset"/>
However, on clicking this field, the myName field is not getting empty.
I also tried defining a javascript function:
<input type="reset" value="Reset" onclick="fnFormReset()"/>
function being:
function fnFormReset(){
alert("here");
document.myForm.myName.value = "";
}
However, this is also not working.
Any solution ??