performance - How define jQuery validate setDefaults -
i have problem code. use jquery validate validate form. question how run setdefaults method? because when looking @ in debugger, error this: typeerror: jquery.validator undefined
jquery.validator.setdefaults({ success : "valid" }); $("#myform").validate({ rules : { "file1" : { required : true, extension : "slx|mdl", accept : false }, "file2" : { extension : "m", accept : false }, "file3" : { extension : "xlsx|xls", accept : false }, "file4" : { extension : "pdf", accept : false } } });
setdefaults need variable must used validate in case validator
just assign validator var validate method
var validator = $("#myform").validate({ rules : { "file1" : { required : true, extension : "slx|mdl", accept : false }, "file2" : { extension : "m", accept : false }, "file3" : { extension : "xlsx|xls", accept : false }, "file4" : { extension : "pdf", accept : false } } });
should work fine
Comments
Post a Comment