Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

Alpha Numeric problem in Javascript..? I Have a textbox and I need this textbox to do the following: 1] First one should be character followed by number [eg A1234] 2]No letter should be typed after the first character. 3]No space should be provided between the character & number.

OpenStudy (anonymous):

What you need to use is regular expressions in Javascript. You can learn more abt it at http://www.w3schools.com/jsref/jsref_obj_regexp.asp

OpenStudy (anonymous):

thanx

OpenStudy (anonymous):

we can do it only with the help of regular expressions var re=new RegExp("[a-zA-Z][0-9\.]{1","g"); try this

OpenStudy (anonymous):

ther's a mistake var re=new RegExp("[a-zA-Z][0-9\.]{1}","g");

OpenStudy (rsmith6559):

Wouldn't: var re = new RegExp( "[A-Za-z][0-9]+", "g" ); or: var re = new RegExp( "[A-Za-z][0-9]{4}", "g" ); do it?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!