| Server IP : 66.29.146.62 / Your IP : 216.73.216.152 Web Server : LiteSpeed System : Linux premium231.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64 User : dokkdzvi ( 925) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/dokkdzvi/morraa-ksa.store/controlPanel/assets/plugins/parsleyjs/src/extra/plugin/ |
Upload File : |
// This plugin replace Parsley default form behavior that auto bind its fields children
// With this plugin you must register in constructor your form's fields and their constraints
// You have this way a total javascript control over your form validation, and nothing needed in DOM
(function($){
window.ParsleyConfig = $.extend(true, window.ParsleyConfig, { autoBind: false });
window.ParsleyExtend = window.ParsleyExtend || {};
window.ParsleyExtend = $.extend(window.ParsleyExtend, {
// { '#selector' : { constraintName1: value, constraintName2: value2 }, #selector2: { constraintName: value } }
// { '#selector' : { constraintName1: { requirements: value, priority: value }, constraintName2: value2 } }
_bindFields: function () {
if ('ParsleyForm' !== this.__class__)
throw new Error('`_bindFields` must be called on a form instance');
if ('undefined' === typeof this.options.fields)
throw new Error('bind.js plugin needs to have Parsley instantiated with fields');
var field;
this.fields = [];
for (var selector in this.options.fields) {
if (0 === $(selector).length)
continue;
field = $(selector).parsley();
for (var name in this.options.fields[selector]) {
if ('object' === typeof this.options.fields[selector][name] && !(this.options.fields[selector][name] instanceof Array))
field.addConstraint(name.toLowerCase(), this.options.fields[selector][name].requirements, this.options.fields[selector][name].priority || 32);
else
field.addConstraint(name.toLowerCase(), this.options.fields[selector][name]);
}
}
this.fields.push(field);
return this;
},
// Do nothing
_bindConstraints: function () {
return this;
}
});
})(jQuery);