I have the following jsp form:
<form action = "dt.jsp" METHOD = "GET" ONSUBMIT="return validateForm()">
<table>
<tr>
<td><input type=date name="fdate"/></td>
<td><input type=date name="tdate"/></td>
</tr>
</table>
<input TYPE = "SUBMIT" VALUE = "Search by date">
</form>
and javascript function:
function validateForm()
{
alert(document.getElementsByName('fdate').value);
return false;
}
when I do the alert I get undefined. why?