F
F
fragsteelpad2017-09-20 14:11:59
Yii
fragsteelpad, 2017-09-20 14:11:59

Dynamic form display?

How to display different form elements depending on the dropDownList value?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-09-20
@fragsteelpad

something like this:

<?php $this->registerJs("
  $('.someDropdown').on('change',function(){
    var valuha = $('.someDropdown').val();
    if(valuha == 12){
       $('.someEl').removeClass('hidden');
     }else{
       $('.someEl').addClass('hidden');
    }
  });
");
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question