hi all,
i am new to javascript
i was trying to passe text input to javascript. but code is not working here is the code
<script type="text/javascript">
function val(){
if(document.a.email.value=="" ||document.a.email.value==null ){
alert("sssss");
return false;
}
if(document.a.email.value!="" ||document.a.email.value!=null ){
alert("sssss"+document.a.email.value);
return true;
}
}
</script>
and here is the HTML code,
<form action="a.php" method="POST" onsubmit="return val();">
<strong>E-Mail Address</strong> *</td><td><input name="email" type="text" value="" />
<input type="submit" value="submit" />
</form>
can anybody tell me the reason not to view the alert message..
and i want if the email is null to stop submiting the data to a.php
thx.