Page 1 of 1

Checkbox issue

Posted: Thu Apr 25, 2024 6:40 pm
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');
    		}
    	});

Re: Checkbox issue

Posted: Thu Apr 25, 2024 7:49 pm
by mobhar