I've a view page which looks like:
<tr>
<td align="right"><b>Select your role:</b></td>
<td align="left">
<select name="role" id="role" onchange="enableTextBox();">
<option value="Admin">Admin</option>
<option value="csc">CSC Employee</option>
</select><br/>
<font color=red>
<form:errors path="role" cssClass="validationError"/>
</font>
</td>
</tr>
<tr align=center>
<td align="right"><b>User ID:</b></td>
<td align="left">
<input type="text" id="uname" name="uname" value="" size="15" /><br/>
<font color="red">
<form:errors path="uname" cssClass="validationError"/>
</font>
</td>
</tr>
<tr align=center>
<td align="right"><b>Password:</b></td>
<td align="left">
<input type=password id="pwd" name="pwd" value="" size="15" /><br/>
<font color="red">
<form:errors path="pwd" cssClass="validationError"/>
</font>
</td>
</tr>
I've validated the page which throws error in red colored font near the input field. Suppose admin logs in and the error message is displayed after validation. Now, if the admin wants to select "csc employee" from the dropdown list, I need these error messages to be remove and just the input fields should be displayed.
Please help me!
Use javascript to clear those form errors using events while typing on those fields...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With