Dear all,
I have this situation. I trying to manage what field is or not readonly based on some checkbox fields.
Everything works just fine but checkbox field.
This is an example code (it is in the Client script->Table specific->Startup script).
//Begin code
// Check if the CheckBox PR is checked …
if($(“input[name=‘x_PR’]:checked”).val()){
$(‘#x_IL’).removeAttr(‘disabled’);
$(‘#x_F3’).removeAttr(‘disabled’);
$(‘#x_F4’).removeAttr(‘disabled’);
} else {
$(‘#x_IL’).attr(‘disabled’,‘disabled’);
$(‘#x_F3’).attr(‘disabled’,‘disabled’);
$(‘#x_F4’).attr(‘disabled’,‘disabled’);
}
// Check if the CheckBox PR is being checked…
$(“input[name=‘x_PR’]”).click(function() {
if (!this.checked) {
$(‘#x_IL’).attr(‘disabled’,‘disabled’);
$(‘#x_F3’).attr(‘disabled’,‘disabled’);
$(‘#x_F4’).attr(‘disabled’,‘disabled’);
} else {
$(‘#x_IL’).removeAttr(‘disabled’);
$(‘#x_F3’).removeAttr(‘disabled’);
$(‘#x_F4’).removeAttr(‘disabled’);
}
});
//End code
The fields PR and IL are CheckBox and the field F3 and F4 are varchar.
This code works for varchar but not for checkbox (F3 and F4 became disabled/enabled when I check PR but IL not)
Any ideea?
Thanks a lot.