Problem
var in=document.forms["form"]["interest"].value;
if(in=="")
{
alert("Please select your preferred course");
return false;
}
Here
in
cannot be a variable name.
Solution
So, change that to some other name like
interest
.
Demo
Now, it is working perfectly.
Check out the Demo -
[Demo] why this javascript function is not calling?[
^].