I have problems with the field that I disable if one of the options is checked, but when the field is as desabled
it does not pass values to PHP.
I would like to know how to check whether the value exists or not, and if it does not exist, set it to null.
I tried to do in several ways but the same error happens:
PHP Notice: Undefined index: f_DAT_FINAL_VINCU
The attempts were:
$campos[':DAT_FINAL_VINCU'] = ((isset($_POST['f_DAT_FINAL_VINCU'])) ? eglise_dataDeDMAParaAMD($_POST['f_DAT_FINAL_VINCU']) : null );
$campos[':DAT_FINAL_VINCU'] = strlen(eglise_dataDeDMAParaAMD($_POST['f_DAT_FINAL_VINCU'])) === 0 ? null : htmlspecialchars($_POST['f_TXT_DESCR_VINCU'], ENT_QUOTES);
$campos[':DAT_FINAL_VINCU'] = strlen(eglise_dataDeDMAParaAMD($_POST['f_DAT_FINAL_VINCU'])) === null ? null : htmlspecialchars($_POST['f_TXT_DESCR_VINCU'], ENT_QUOTES);
How do I do it?
I'm putting the field via jQUERY but it's not working looks like I do:
var variavel = $('#f_FLG_STATU_VINCU').val();
if (variavel == "A") {
$('#f_DAT_FINAL_VINCU').val(null);
}
$('#f_FLG_STATU_VINCU').change(function () {
var variavel = $(this).val();
var today = new Date();
if (variavel == "A") {
$('#f_DAT_FINAL_VINCU').val(null);
$('#f_DAT_FINAL_VINCU').prop("readonly", true);
} else {
$('#f_DAT_FINAL_VINCU').prop("readonly", false);
$('#f_DAT_FINAL_VINCU').datepicker("setDate", today);
}
});