skyer2000
(Chadhuntley)
September 20, 2013, 1:14pm
22
Hi please see this forum
i hope it’s some help.
Unfortunately no, the form I’m working with does not actually submit, what I need to do is fire the form validation upon pressing a button that does not submit.
jayasam
(Jayasameera)
January 16, 2014, 4:15pm
23
With this, all the code to manually trigger validation is…
var form = $("#formId");
var settings = form.data('settings') ;
settings.submitting = true ;
$.fn.yiiactiveform.validate(form, function(messages) {
if($.isEmptyObject(messages)) { // If there are no error messages all data are valid
$.each(settings.attributes, function () {
$.fn.yiiactiveform.updateInput(this,messages,form);
});
//We update each attribute again even if there are no messages so that any error messages disappear. Good if your request takes long so the user doesn't see errors
successFunction();
} else {
// Fields acquiring invalid data classes and messages show up. Update the inputs.
settings = form.data('settings'),
$.each(settings.attributes, function () {
$.fn.yiiactiveform.updateInput(this,messages,form);
});
settings.submitting = false ;
}
});
[size="3"]I need to get the return value of this method. I tried to return true/false but failed. Need help [/size]