How to to hide fields on select radio?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
alex
User
Posts: 267

How to to hide fields on select radio?

Post by alex »

Hello! I used a script to hide fields on select radio which doesn't work anymore.

// Startup script I used:

    $("input[name='x_form']").change(function(){
      if ($("input[name='x_form']:checked").val() == '0'){ // doesn't react
      $('#r_inn').hide();
    } else { 
      $('#r_inn').show();
    }
    });

// Client script worked as follows:

	$("input[name='x_form']").change(function() {
	if (this.value == '1' || this.value == '2'){ // doesn't react
	  $('#r_inn').hide();
	} else {
	  $('#r_inn').show();
	}//End If Then
	}); //End Input Change

Please advise how to make it working.


arbei
User
Posts: 9384

Post by arbei »

Radio buttons are actually Select2, you may read Select2 docs on Events.


alex
User
Posts: 267

Post by alex »

Thank you!


Post Reply