# Form Validation

[jQuery Validation](https://jqueryvalidation.org/) plugin makes simple clientside form validation easy, whilst still offering plenty of customization options. It makes a good choice if you’re building something new from scratch, but also when you’re trying to integrate something into an existing application with lots of existing markup.

#### Step 1

Add JavaScript file before end body tag

```markup
<script src="assets/vendor/jquery.validate/jquery.validate.min.js"></script>
```

#### Step 2

Add Markup

```markup
<form class="needs-validation" action="#">
    <div class="form-row">
        <div class="form-group floating-label col-md-12">
            <label>Email</label>
            <input type="email" required class="form-control" placeholder="Email">
        </div>
        <div class="form-group floating-label col-md-12">
            <label>Password</label>
            <input type="password" required class="form-control " id="password"
                   placeholder="Password">
        </div>
    </div>
    <button type="submit" class="btn btn-primary btn-block btn-lg">Login</button>
</form>
```

#### Step 3

Initialize the Plugin

```javascript
$(".needs-validation").validate({
        errorClass: "is-invalid",
        validClass: "is-valid",
    });
```

{% embed url="<https://jqueryvalidation.org/>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atomui.com/form-elements/form-validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
