What does your <form> tag look like?
Might need to be
Code:
<form name="myForm" action="???" method="post" onsubmit="return validator()">
Might try changing the following (I'm not sure I understand your logic or needs here):
Code:
var flag = true;
if (l1 == null || l1 == "") { flag=false; alert("error "); }
if (l2 == null || l2 == "") { flag=false; alert("error"); }
if (right == null || right == "") { flag=false; alert("error"); }
if ((flag == true) && (right == 1)) { alert("Correct"); }
if (flag == false) { alert("Incorrect incorect"); }
return flag;
Bookmarks