---
title: "Jquery Validation Client side"  
description: "Hi everyone in this blog I’m explaining about jquery validation.Description:\"But doesn't jQuery make it easy to write your own validation plugin?\"  Su"  
author: "Anonymous User"  
published: 2015-02-06  
updated: 2015-02-06  
canonical: https://www.mindstick.com/blog/763/jquery-validation-client-side  
category: "javascript"  
tags: ["jquery", "jquery validate", "jquery plugins"]  
reading_time: 2 minutes  

---

# Jquery Validation Client side

Hi everyone in this blog I’m explaining about [jquery validation](https://www.mindstick.com/forum/158280/how-to-include-jquery-validation-in-a-web-page).

Description:

"But doesn't jQuery make it easy to write your own validation plugin?"\
Sure, but there are still a lot of subtleties to take care of: You need a standard library of validation methods (such as emails, URLs, [credit card](https://www.mindstick.com/articles/23592/how-can-you-earn-maximum-reward-points-on-credit-cards) numbers). You need to place [error messages](https://www.mindstick.com/forum/160245/how-to-customize-error-messages-with-a-data-annotation-in-asp-dot-net-core) in the DOM and show and hide them when appropriate. You want to react to more than just a [submit event](https://answers.mindstick.com/qa/93831/how-occur-submit-event-in-html-page-and-how-to-handle-in-jq), like keyup and blur.\
You may need different ways to specify [validation rules](https://www.mindstick.com/forum/158293/is-it-possible-to-create-custom-validation-rules-using-jquery-validation-if-so-how) according to the server-side enviroment you are using on different [projects](https://www.mindstick.com/articles/105927/how-to-excel-at-managing-multiple-projects). And after all, you don't want to reinvent the wheel, do you?

"But aren't there already a ton of validation plugins out there?"

Right, there are a lot of non-jQuery-based [solutions](https://www.mindstick.com/blog/12005/how-to-get-customized-solutions-with-software-development-company-in-noida) (which you'd avoid since you found jQuery) and some jQuery-based solutions. This particular one is one of the oldest jQuery plugins (started in July 2006) and has proved itself in projects all around the world. There is also an article discussing how this plugin fits the bill of the should-be validation solution.

##### Example:

```
<link href="~/Content/bootstrap.min.css" rel="stylesheet" /><div class="container">    <div class="row">        <div class="well col-md-6 col-md-offset-3">            <h3 class="text-center text-primary">Login</h3>            <hr />            @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { @id = "commentForm" }))            {                <div class="row form-group has-feedback">                    <div class="col-md-12">                                                <label for="cname">Name (required, at least 2 characters)</label>                        <input id="cname" name="name" class="form-control" minlength="2" type="text" required>                    </div>                </div>                <div class="row form-group has-feedback">                    <div class="col-md-12">                        <label for="cemail">E-Mail (required)</label>                        <input id="cemail" type="email" class="form-control" name="email" required>                    </div>                </div>                <div class="row form-group has-feedback">                                        <div class="col-md-12">                                                <label for="curl">URL (optional)</label>                        <input id="curl" type="url" class="form-control" name="url">                    </div>                </div>                  <div class="row form-group has-feedback">                    <div class="col-md-12">                        <label for="ccomment">Your comment (required)</label>                        <textarea id="ccomment" class="form-control" name="comment" required></textarea>                    </div>                </div>                <div class="col-md-12 text-right"><button type="submit" class="btn btn-primary">Submit</button></div>             }        </div>    </div></div><script src="~/Scripts/jquery.min.js"></script><script src="~/Scripts/jquery.validate.min.js"></script><script>    $("#commentForm").validate();</script>
```

Output:

1. When run [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) first time

![Jquery Validation Client side](https://www.mindstick.com/blogs/a52d8b77-528e-408f-8306-6e9315d2b24c/images/c67759d8-3a42-4ccd-84e4-5fcd87656dff.png)

2. When submit form without fill any field

![Jquery Validation Client side](https://www.mindstick.com/blogs/a52d8b77-528e-408f-8306-6e9315d2b24c/images/4ae5f55b-e548-43bc-a365-21117199313d.png)

3. When fill name field and emailed(not [correct format](https://www.mindstick.com/forum/72/input-string-was-not-in-a-correct-format)) field

![Jquery Validation Client side](https://www.mindstick.com/blogs/a52d8b77-528e-408f-8306-6e9315d2b24c/images/b0532e33-5b53-4091-abbb-6a9a2fd01a20.png)

4. When fill name field, emailed field and url field(not correct format)

![Jquery Validation Client side](https://www.mindstick.com/blogs/a52d8b77-528e-408f-8306-6e9315d2b24c/images/abb4c32c-27ce-4117-aa2e-7ae900a71cc2.png)

in my next post i'll explain about [Getting Started with Linq Queries](https://www.mindstick.com/blog/782/Getting%20Started%20with%20Linq%20Queries#.VQEw_PmUdz8)

---

Original Source: https://www.mindstick.com/blog/763/jquery-validation-client-side

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
