Hello,
I have a situation: In an edit screen when the value of a value field is changed, I need to ask the user if they want to change the values ​​of other records in the same table.
I did this part in javascript
$("#x_vldespesa").on('change', function(e){
alertify.confirm('Deseja atualizar os valores nas despesas gerados neste intervalo, que ainda estão abertos?', function (ok) { $.post(ew_CurrentPage(), { "myajax": 1, "token": EW_TOKEN, "value": "1"}); }).set('title', 'Confirmação');
});
and in row_updated has a part in php to run a mysql sp that does the updates.
In page_render archive edit.php
if (@$POST["myajax"] == 1 && @$POST["value"] != "") { // Check if it is your custom Ajax and if the query value is present
$SESSION["inorigemgeradod"] = $POST["value"];
$this->Page_Terminate(); // Terminate the page
} else {
$_SESSION["inorigemgeradod"] = "0";
}
function Row_Updated
if ($SESSION["inorigemgeradod"] == "1") {
if ($rsold['cddespesa'] <> "") {$cddespesa = $rsold['cddespesa'];} else {$cddespesa = $rsnew['cddespesa'];}
unset($SESSION["inorigemgeradod"]);
ew_Execute("call fin06_spatualizaintervalo(1,".$inorigemgerada.",".$cddespesa."); ");
}
My problem is that the question that is asked to the user has 2 buttons if you click ok but does not click. I should not change anything but I can not use alertify.confirm correctly. What is wrong?