hi,can any one tell me how to validate the dropdown box? and why the below code not working?
<html>
<head>
<title>WebCheatSheet - JavaScript Tutorial</title><script>
function validateFormOnSubmit(theForm) {
alert("dfdsf");
var reason = " ";
reason =validateuniversity(theForm.univer);
if (reason != "") {
alert("Some fields need correction:\n" reason);
return false;
}
return true;
}
function validateuniversity(fld){
var error = "";
if(fld.value== Select answer )
{
error= "dddddfdfdffs";
}
return error;
}
</script>
<body>
<form name="demo" onsubmit="return validateFormOnSubmit()" action=" ">
<fieldset>