
One of the best SEO tips you can ever find is creating videos for SEO...
Jquery Validation is simple, it doesn't have to be a scary or time-consuming process. This tutorial shows you how to set up a basic form validation with jQuery. Here i am going to use jQuery Validation Plugin, it makes simple clientside form validation easy, whilst still offering plenty of customization options.
First, we need to include jQuery as the validation plugin is currently only compatible with jQuery versions lower than 2.0.
Create a new HTML file named index.html and include jQuery before the closing tag:
Include the plugin after jQuery, or you can download them in your folder and call them from there:
Now you need to create a form in html, For the mail sending we want to collect the following user information:
1. Name
2. Email
3. Phone Number
4. Message
So, let’s create our form containing these input fields:
Say Hello!
< form id="form" action="#" method="post" > < input type="text" name="name" placeholder="Name..." /> < input type="text" name="email" placeholder="Email id..." /> < input type="text" name="phone" placeholder="Phone..." /> < textarea name="message" placeholder="Message..." > textarea > < button value="Submit" > Submit < button > form >
You can create style for the form to look good and attractive, here it goes:
Finally create validation rules for the form like this, its easy:
That’s it, you’re done! Now you have an idea how to set up form validation with jQuery. Thank you!! Hope you liked it.
Founder / Marketing Expert
One of the best SEO tips you can ever find is creating videos for SEO...
When it comes to putting up your company's website, one of the first decisions you'll have to m...
Want to make a stunning logo for your website? If ...
Mobile has developed as a basic par...
Digital Marketing moves at an alarming vel...
Money is the primary goal wh...