Answer the question
In order to leave comments, you need to log in
How to validate and submit data using yiiActiveForm?
Explain how you can set parameters and validate submit to REST using js.
InitEditUser: function (event) {
var target = $(event.target);
var url = 'http://' + window.location.hostname + '/users/' + target.attr('id');
$('#editUser').modal('show');
$('#editUserForm').data('yiiActiveForm').validationUrl = "http://tr.loc";
$.ajax({
type: 'GET',
url: url,
success: function (data, textStatus, jqXHR) {
console.log(data);
$('#editUserInput').val(data.login);
$('#editUserFullNameInput').val(data.full_name);
$('#editUserEmailInput').val(data.email);
$('#editUserForm').on('beforeSubmit', function () {
console.log("a");
return false;
});
$('#editUserForm').on('afterValidate', function () {
console.log("b");
});
},
error: function (jqXHR, textStatus, errorThrown) {
}
});
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question