FoxStudent
Technical User
I am trying to get this java script function to work when a button is clicked. I do not get the code highlighted as if there is a syntax error. However, when the page is previewed I get the message 'Done, but with errors on page' on the status bar. Has anybody any suggestions thanks.
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<function CheckPassword(){
varPassword = EmailSingup.frmCreateEmail.txtPassword.value;
varPassConfirm = EmailSignup.frmCreateEmail.txtConfirmPassword.value;
if(varPassword == varPassConfirm)
{ return true;
}
else
{ alert("Your two passwords do not match"
;
return false;
}
}
>
</script>
This code appears later on in the body of the page.
<input type="button" name="cmdCheck" value="Check Availability" onClick = "CheckPassword()">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<function CheckPassword(){
varPassword = EmailSingup.frmCreateEmail.txtPassword.value;
varPassConfirm = EmailSignup.frmCreateEmail.txtConfirmPassword.value;
if(varPassword == varPassConfirm)
{ return true;
}
else
{ alert("Your two passwords do not match"
return false;
}
}
>
</script>
This code appears later on in the body of the page.
<input type="button" name="cmdCheck" value="Check Availability" onClick = "CheckPassword()">