Checkbox issue

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

Checkbox issue

Post by dheeksha2511 »

I am migrating the following code from php maker 2018 to 2023 . The checkbox id is changing dynamically and it is not working, how do i solve this.

$("#x_SIMULATION_AND_OTHER_REQ\\[\\]_0").click(function() {
    		if ($(this).prop('checked') !== false) {
    			$("#thermaldt_id").show();
    		}
    		else {
    			$("#thermaldt_id").hide();
    			$("#x_THERMAL_DATE").val("");
    			$('#el_mdd_requests_THERMAL_DATE').removeClass('has-error');
    		}
    	})
    	$("#x_SIMULATION_AND_OTHER_REQ\\[\\]_1").click(function() {
    		if ($(this).prop('checked') !== false) {
    			$("#structuraldt_id").show();
    		}
    		else {
    			$("#structuraldt_id").hide();
    			$("#x_STRUCTURAL_DATE").val("");
    			$('#el_mdd_requests_STRUCTURAL_DATE').removeClass('has-error');
    		}
    	});
    	$("#x_SIMULATION_AND_OTHER_REQ\\[\\]_2").click(function() {
    		if ($(this).prop('checked') !== false) {
    			$("#cablingdt_id").show();
    		}
    		else {
    			$("#cablingdt_id").hide();
    			$("#x_CABLING_DATE").val("");
    			$('#el_mdd_requests_CABLING_DATE').removeClass('has-error');
    		}
    	});

mobhar
User
Posts: 11745

Post by mobhar »


Post Reply