views:

1329

answers:

2

I"m building a registration form, and I need to validate the user's inputs. (username, email, password).

I have regular expressions set up for each of these, and I can easily validate each in PHP using preg_match, and if it returns false, I can display an error.

However, I think it'd be much nicer if the page did not have to refresh to display the error. Is there a javascript/ jQuery equivalent of preg_match?

Thanks in advance for the help! I really appreciate it.

-Giles Van Gruisen http://gilesvangruisen.com/

(PS, I've seen the jQuery "validate" plugin, but I'd much prefer to do it myself)

+2  A: 

Sure here is ref: from w3cscools

Eldar Djafarov
+2  A: 

The jquery.validate plugin is fantastic! It's quite polished and by adding your own custom validation methods you can make it validate almost everything you want. Why would you want to re-invent the wheel?

Adrian Grigore