I want to add JavaScript validation to my input.
The Form is generated dynamically as per the information from database. I have field called regex where i store the expression to be applied to that field So I fetch the regex but how to apply it to the form ? I want to allow only comma separated numbers how to do this:
This is my generated HTML
<tr>
<td>Codec</td>
<td><input type="text" name="Codec" value="8"/></td>
</tr>
This is the regex i want to apply to my input : ^[0-9 _ ,]*$
What should be my java-script to check the input?