Jump to content

match() small problem


robert_gsfame

Recommended Posts

I wish to validate textbox so that anything besides numeric is not allowed

I try to use isNan but not working (don't know why) then i try to use match()

 

here is the code

var test = /[0-9]+$/;

 

if(!(mystring.match(test))

alert("wrong");}

 

when i type "1234abc" alert appear but when i type "abc1234" alert not appear

which part should be modified?

 

thx in advance

 

 

Link to comment
https://forums.phpfreaks.com/topic/199753-match-small-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.