How to validate email address like [email protected] using javascript onsubmit method.?
-
This script send email [email protected]. But not send [email protected](email address). how to send like this email([email protected]). I used script below. form_validation.js function EmailValid(email) { if(email=="") { alert("Email is required field!") return false } len = email.length if((email.charAt(1)=='@')||(email.ch… { alert("Invalid Email Please try again!") return false } if((email.charAt(len-2)=='@')||(emai… { alert("Invalid Email Please try again!") return false } count=0 dotcount=0 for (i=0; i< email.length; i++) { if(email.charAt(i)=='@') count++ if(email.charAt(i)=='.') dotcount++ } if((count !=1)||(dotcount !=1)) { alert("Invalid Email Please try again!") return false } return true } myform.js function valForm() { if(!EmailValid(document.myform.email… { return false } }
-
Answer:
Use regular expressions to validate emails. Its far easier and your code will only be a few lines
Dulanjal... at Yahoo! Answers Visit the source
Related Q & A:
- How do i change my account into a yahoo.com from yahoo.com.au?Best solution by Yahoo! Answers
- How do I change my email address on yahoo to a different email address but still on yahoo?Best solution by Yahoo! Answers
- How do I import e-mail from my Yahoo.com address to my ATT.net address?Best solution by Yahoo! Answers
- How can I move my sbcglobal.net address book to my yahoo.com address book?Best solution by Yahoo! Answers
- Can I create a separate email address under my current Yahoo address?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.