guillaumepotier / Parsley.js

Validate your forms, frontend, without writing a single line of javascript

Home Page:http://parsleyjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to exclude field from validation ?

MROALI opened this issue · comments

Hello, i have a multistep form, and i need to exclude on fly some field depending on some critrerias...

I tried to implement field:validate , but not working. Do you have anyidea how can i do it, any idea ?

Parsley.on("field:validate", function(field) {
    var objField = field.$element
	if(!isFieldToValidate(objField)){
          objField.attr("data-parsley-excluded","true");
        return false;  
	}
	return true;
});

Interdependencies are not super easy to handle. See this example and #949.

Good luck.