I have html form and I want to add validation on user input – example user name filed must start with alpha and zip code must be numeric.
> <tr>
<td>username</td>
<td><input type="text" name="user name" placeholder="Must start with Alpha"></td>
</tr>
> <tr>
<td>zipcode</td>
<td><input type="text" name="zipcode" placeholder="Must be 5 digit numeric"></td>
</tr>
is there any simple way to enforce this rule if not send error. I am new and this is for simple internal site prefer not complicated solution.
if you’re wanting a form verification and not an on the fly verification, I would suggest the html5 numeric fields in addition to a “pattern” attribute.