Retrieving selection by jQuery

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

Retrieving selection by jQuery

Post by Cat »

This code stopped working in version 2024

$("#r_ACTUACION_REALIZADA_POR").hide();
$("#r_TAREAS_PENDIENTES").hide();

$(document).ready(function(){  
  $("#x_TIPO_SEGUIMIENTO").change(function() {
	 var str = $("option:selected", this);
	 if (this.value == "Actuación") {
	    $("#r_ACTUACION_REALIZADA_POR").show();
        $("#r_TAREAS_PENDIENTES").show();
        
	 } else {
	    $("#r_ACTUACION_REALIZADA_POR").hide();
        $("#r_TAREAS_PENDIENTES").hide();
        
 	 }
  });
});

There is no error in the console and I checked all the field names and everything is fine


arbei
User
Posts: 9433

Post by arbei »

Cat wrote:

var str = $("option:selected", this);

In newer versions, lookup fields selection lists are Select2 widgets (not regular HTML <select>) by default. To get selected options, read Retrieving selections.

You should also search "updatedone" in this forum and it the docs.


Post Reply