alex-w
(Pr0j3ct A1ex)
1
If you want to use forms validation but send the data in your own ajax request it gets a bit tricky (Unless i’m doing it wrong
)
Handy if you could fire validation manually and use the done/fail callbacks.
Something like,
$('#myform').yiiactiveform('validate')
.done(function() {
}).fail(function() {
});
alex-w
(Pr0j3ct A1ex)
2
Refresh,
...
$.fn.yiiactiveform.validate = function(form) {
var $form = $(form), $form.data('settings'), validation = [];
//Build an array of deferred validation functions.
return $.when.apply(this, validation).fail(function() {
//Update summary
});
}
...
The developer can then use the function manually.
$.fn.yiiactiveform.validate(myform).done(function() {
//All is good
});
jeroen84
(Jeroendenhaan)
3
What exactly are you trying to do?
An ajax validation? And do X when it succeeds and Y when it fails?