I'm trying to validate some fields in my form but can't get it to work. I think it's because of the submit button code. Could someone please help identify the problem?
<script language="JavaScript">
function validate_form ( )
{
if ( document.leaveform.dc1.value == "" )
{
alert ( "Please select start date" );
valid = false;
return valid;
}
}
<input name="b1" type="button" value="Submit Without Preview"
ONCLICK ="this.form.action ='fastsaveregistrationdetails.jsp';this.form.submit()">