Toms, thanks, nuAddJavascript($j) made it work
Now I have an issue to populate my form. I'm trying to populate two checkboxes:
Capture d’écran 2018-07-01 à 20.42.25.png
The JS code is:
Code: Select all
if (nuIsNewRecord()) {
if (employe_ch() == 1) {
$('#contact_ch').val(1).change();
}
if (employe_fr() == 1) {
$('#contact_fr').val(1).change();
}
nuHasNotBeenEdited();
};
But the checkboxes do not populate. I used the console to test my JS code, here is the result:
Capture d’écran 2018-07-01 à 20.41.36.png
So it shows that the conditions work and should populate. So the issue is on this line I guess:
I also tried:
Code: Select all
$('#contact_ch').val("1").change();
And:
Code: Select all
$('#contact_ch').val('1').change();
Maybe to populate a checkbox, .val().change() doesn't work?
You do not have the required permissions to view the files attached to this post.