there is an input type box as this:
<input type="text" name="xlnum" id="xlnum" />
<input type="submit" value="Submit" id="submit" />
the allowed value that are inputted in the text box is number. but it style must be as this:
number1,number1,number1,number1,number1.... eg(1,2,,12,35,654,....)
if the user types the wrong style. i want to give him a tip use jquery.how do i do. i don’t know how to write the if part.
eg:
$('#submit').click(function() {
if($('#xlnum').val()=='' && ...)...
})
BAM!
That is the simplest form verification Method I know. Make sure your jquery.js is recent enough. I have not tested any other than version 1.6.1. And I think the other guys regex is more elegant.
The guy above me failed, hahah. I thought his method was kinda short and neat but doubted it would work. I was right. It goes into infinite recursion.