Hello all,
I got a form button with php code inside.
When I click on it the first message is …
echo ‘<script>alert(“Attention, now it will be create an Order which will contain all rows selected
All row previously selected will be deleteted”);</script>’;
How can I stop the prosecusion if the user instead ok click the “OK” button of Alert — it press “ESC” key to abandon the action.
If click ESC —> sc_exit(sel); or to previous form
If click OK —> carry on doing code.
I founded this googling but I don’t know how insert PHP code or macro (sc_exit(sel); or all code to run if YES) into an echo istruction
For istance x is a variable == true or == false ?? In SC I need to use $var not var only correct ?
Can I refer to it out of the echo line like IF (x==false) {sc_exit(sel); } else { run php code }
echo ‘<script type=“text/javascript”>
var x=window.confirm(“Are you sure you are ok?”)
if (x)
window.alert(“Good!”)
else
window.alert(“Too bad”)
</script>’;
Thanks