Hi I have created a registration form(sample one fro trial). But if i dont give the value in the field,still it submit. So I need to validate the field using java script and have to give a message"please fill the form" if the field is kept empty. this is my code
<html>
<body>
<form name="reg1" action="try.php" method="post">
<table>
<table border="0" cellpadding="0" cellspacing="0" width="779" align="centre">
<tr>
<th>Registration form</th></tr>
</tr>
<tr><TD align="left">username<TD/>
<TD><input type="text" name= "usr"></TD></tr>
<tr>
<td align="left">address1<td/>
<td><input type="text" name="addr1"></td>
</tr>
<tr>
<td align="left">address2<td/>
<td><input type="text" name=addr2></td></tr>
<tr>
<td align="left">password<td/>
<td><input type="password" name="pswd"></td>
</tr>
<tr><TD></TD>
<td><input type="submit" name="submit" value="submit"></td></tr>
</table>
</form>
</body>
</html>
can please anyone help????