Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if jQuery Validation Engine is loaded?

I'm trying to use this validator: http://posabsolute.github.com/jQuery-Validation-Engine/ I load it just when a page has a form. But I have several pages with 2 form, both are loading with ajax. So, I need to check for each form before load: is the Validator loaded or not. how can I to check this? Thanks.

like image 232
Denis Monn Avatar asked Mar 03 '13 12:03

Denis Monn


People also ask

What is jQuery validation engine?

jQuery validation engine is a Javascript plugin aimed at the validation of form fields in the browser (IE 6-8, Chrome, Firefox, Safari, Opera 10). The plugin provides visually appealing prompts that grab user attention on the subject matter. 3k. http://www.position-relative.net/ Tags: form, field, validation, jquery.

What is jQuery validation plugin?

A jQuery validation plugin for Bootstrap. It's basically just a wrapper around native form validation using HTML5 attributes, but can also be used to add custom rules. It always shows error messages from the browser, automatically translated into the correct language. HTML.

How we can use jQuery validation plugins in MVC?

The jQuery validation plugin leverages a CSS selector like syntax to apply a set of validation rules. You can download the plugin (js) file from jQuery website. The password and confirm password objects are matched by the validation plugin for you and shows the message on the equalTo attribute if they don't match.

What is validator addMethod in jQuery?

validator. addMethod( name, method [, message ] ) Description: Add a custom validation method. It must consist of a name (must be a legal javascript identifier), a javascript based function and a default string message.


1 Answers

You can check for the existence of $.validator:

if ($.validator) {
    // $.validator is defined
}
like image 151
Konstantin Dinev Avatar answered Oct 04 '22 10:10

Konstantin Dinev