nischalinn
04 Jun 2011, 12:23 PM
I've created a form.
**********************************************************************
<form id="form1" method="post">
<table border="0">
<tr>
<td>User Id</td>
<td><input type="text"name="User Id" id="UserId" /></td>
</tr>
<tr>
<td>Date</td>
<td><input type="text"name="DateOfReg" id="DateOfReg"/></td>
</tr>
<tr>
<td>E-mail Address:</td>
<td><input type="text"name="E-mail Address:" id="Email"/></td>
</tr>
<tr>
<td>Name:</td>
<td><input type="text"name="NameOfUser" id="NameNameOfUser"/></td>
</tr>
<tr>
<td><input type="image" src="SUBMIT.gif" id="SubmitButton"/></td>
<td><input type="image" src="RESET.gif" id="ResetButton"/></td>
</tr>
</table>
</form>
*******************************************************************
Now I want to write javascript code for the processes inside the HTML file:
1. check for the condition if any of the cell is NULL, if any one of the cell is NULL give an alert message.
2. validation of e-mail address, like it must contain atleast one '@' 'dotcom(.com)'
3. check the length of the name input
I am learning javascript and not getting idea how to perform this task. Will anyone help me???
**********************************************************************
<form id="form1" method="post">
<table border="0">
<tr>
<td>User Id</td>
<td><input type="text"name="User Id" id="UserId" /></td>
</tr>
<tr>
<td>Date</td>
<td><input type="text"name="DateOfReg" id="DateOfReg"/></td>
</tr>
<tr>
<td>E-mail Address:</td>
<td><input type="text"name="E-mail Address:" id="Email"/></td>
</tr>
<tr>
<td>Name:</td>
<td><input type="text"name="NameOfUser" id="NameNameOfUser"/></td>
</tr>
<tr>
<td><input type="image" src="SUBMIT.gif" id="SubmitButton"/></td>
<td><input type="image" src="RESET.gif" id="ResetButton"/></td>
</tr>
</table>
</form>
*******************************************************************
Now I want to write javascript code for the processes inside the HTML file:
1. check for the condition if any of the cell is NULL, if any one of the cell is NULL give an alert message.
2. validation of e-mail address, like it must contain atleast one '@' 'dotcom(.com)'
3. check the length of the name input
I am learning javascript and not getting idea how to perform this task. Will anyone help me???