jquery: validate that text field is numeric
- by George Johnston
I have simple issue -- I would like to check a field to see if it's numeric if it is not blank. I'm not using any additional plugins, just jQuery. My code is as follows:
if($('#Field').val() != "")
{
if($('#Field').val().match('^(0|[1-9][0-9]*)$'))
{
errors+= "Field must be numeric.<br/>";
success =…