E
E
EVOSandru62015-10-15 11:20:52
Yii
EVOSandru6, 2015-10-15 11:20:52

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;
      }
 });

I don’t get into this block, only framework validation works in this case.
Is it possible in Yii1 to create custom validator using jquery code block?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question