jQuery "click" event not triggering after update

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sclg
User
Posts: 149
Location: UK

jQuery "click" event not triggering after update

Post by sclg »

Don't know if this is related to my post of about half an hour ago about dropdowns - maybe I'm missing something obvious.

Updating app from v2020 to v2024.
I have a custom field called PayRF which is a tick box. Inspection shows it's id as #x_PayRF[]
In the 2020 version I have a startup script...

$("#x_PayRF\\[\\]").click(function() {
	if (!$(this).is(':checked')) {
	$("#x_RFAmount").val('0');
	}

which worked fine. It never triggers in 2024.
Any ideas?


arbei
User
Posts: 9384

Post by arbei »

You should use "change", e.g.

$("#your_id").on("change", function() {
    // your code
});

sclg
User
Posts: 149
Location: UK

Post by sclg »

Thank you


Post Reply