Answer the question
In order to leave comments, you need to log in
Is it possible in Yii1 to create custom validator using jquery code block?
Good afternoon,
When adding the main model, it became necessary to throw 2 levels of related models. Additional validation on the client is required. As I understand it, if the form is set to: 'enableClientValidation' => true,
Then some kind of click is already hung on the button , I tried to pick it up using jquery (the button is #add-hote l):
$('#add-hotel').click(function(e)
{
e.preventDefault();
var length = $('#rooms-list').find('[data-name="name"][data-allow="false"]').length;
alert('Кол-во: ' + length);
return false;
if(length)
return true;
else
{
displayMessage('Пожалуйста заполните все наименования номерао', 'warning');
return false;
}
});
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