Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am filling a form that contain several field but i leave a field (textbox(email) ) empty or write any thing other than main in textbox field. it will show a alert type message.

there can be other filled which may be empty. but at a time a single message will appear.
Posted
Comments
Sunasara Imdadhusen 8-May-14 3:27am    
So what you want? do you want to alert all field validation message in single? However please provide code snippet as well!!
Member 10695198 8-May-14 4:03am    
you tell me only how we can validate email only using jquery.
Vi(ky 8-May-14 3:32am    
requirement not clear

1 solution

No need javascript. In HTML5, you can use <input type="email"> to define a text field that should contain an email address and will automatically validate that the entry is of valid email format when the form is submitted. In addition, you can add a "required" attribute to reject empty input.
<input type="email" id="email" name="email" placeholder="someone@gmail.com" required>

Read more from: Beginner's Guide to HTML5 & CSS3 - Formidable Forms with HTML5[^]
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900