hello friend,
i have an action button in footer-extras.php to send an email, but i need it to be send only after the user pressed the "Save Changes" button.
is there a way to check if the button was pressed ?
thanks,
shay.
action button after "Save Changes" was pressed
Re: action button after "Save Changes" was pressed
First, check if SelectedID is defined at all. Will only be set after very first save (after insert).
Additionally you can hide (or remove) the button in form.onChange event using javascript.
Additionally you can hide (or remove) the button in form.onChange event using javascript.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityRe: action button after "Save Changes" was pressed
thanks for your reply Jan,
first i am using this code to see if SelctedId is set:
and then i try:
but even when i dont press the save button it still sends the email,why?
first i am using this code to see if SelctedId is set:
Code: Select all
$checkSelectedID = isset($_POST['SelectedID']) ? makeSafe($_POST['SelectedID']) : 0;
Code: Select all
if (isset($_POST['SelectedID'])) {
if (isset($_POST['submit'])) {
$mail = [
"to" => "shay@qlc.co.il",
"name" => "נשלח על ידי " . $Tname,
"message" => "http://tasks.qlc.co.il:10501/tasks/inventory_report_view.php?SelectedID=" . $checkSelectedID,
"subject" => "התקבל טופס הזמנת ציוד בתאריך " . $json . " מאת הטכנאי " . $Tname,
"debug" => 4
];
sendmail($mail);
}
}
Re: action button after "Save Changes" was pressed
Hi,
just a short question to understand you need. Why cant you put your code in the _after_update hook?
just a short question to understand you need. Why cant you put your code in the _after_update hook?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.