We have seen many Regular Expression tutorials in VB.NET and C-sharp, this is our first JavaScript tutorial on Regular Expressions. So today we’ll see how to validate an email address that's being entered to a textbox. We have a textbox and a button, when you enter something into the textbox and click on the “validate” button it’ll tell if It’s an email address or not(being noob GRRR!).
Add our JavaScript first(make sure you add it to the head) :
Next add the input box and the validate button :
That’s all. You can use this for some kind of subscription button or register/login forms. I hope this little snippet is helpful for you.
Add our JavaScript first(make sure you add it to the head) :
Next add the input box and the validate button :
That’s all. You can use this for some kind of subscription button or register/login forms. I hope this little snippet is helpful for you.
2 comments
Regular Expression Support
ReplySimple Patterns
Complex Patterns
Understanding the RegExp Object
Common Patterns
Browser and Operating System Detection
The Navigator Object
Methods of Browser Detection
A (Not So) Brief History of the User-Agent String
The Browser Detection Script
The Platform/Operating System Detection Script
The Full Script
Example: A Login Page
All about Events
Events Today
Event Flow
Event Handlers/Listeners
The Event Object
Types of Events
Cross-Browser Events
javascript code examples help to learn javascript easy
ReplyPost a Comment
Note: Only a member of this blog may post a comment.