Click to See Complete Forum and Search --> : form validation javascript isnt working .....


binmehar
04-19-2003, 10:55 PM
...i dont know y . as there seems to be no error ...
hers is the code ...

<title>Login</title>
<SCRIPT LANGUAGE = "JavaScript">

function validate(){

var reg = document.f1.reg_no.value;
var pss = document.f1.pass.value;

if (reg=="")
{
alert('You can't proceed without Registeration number.Please Enter it!);
event.returnValue=false;
}

if (pss=="")
{
alert('You can't proceed without password.Please Enter');
event.returnValue=false;
}

}

</SCRIPT>

.....

<form name="f1" action="ado_st.asp" method=post onSubmit="return validate();" >

......

khalidali63
04-19-2003, 10:59 PM
in the function after both valdation blocks put this line of code

return true;