Alert Pop Up message

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
utony
Veteran Member
Posts: 93
Joined: 2020-04-03 18:37

Alert Pop Up message

Post by utony » 2022-12-03 23:16

Looking for some assistance.

I want to be able from the DV page, to click on the "Print Preview" button and a pop up message appears to display a message. The user will have to acknowledge before clicking the print button. Any assistance would much appreciated.

Looking for code help and location to put it .

Thank you!!!!!

-JS-?????

utony
Veteran Member
Posts: 93
Joined: 2020-04-03 18:37

Re: Alert Pop Up message

Post by utony » 2022-12-05 21:03

anyone?????????

User avatar
jmcgov
Veteran Member
Posts: 81
Joined: 2018-12-19 01:31
Location: Northern Ireland

Re: Alert Pop Up message

Post by jmcgov » 2023-03-18 20:54

Did you get this done, or would you like me to explain

User avatar
zibrahim
Veteran Member
Posts: 138
Joined: 2020-01-28 18:30
Location: Malaysia

Re: Alert Pop Up message

Post by zibrahim » 2023-03-22 02:49

Hi there,
Based on Master Jan's original code
viewtopic.php?f=4&t=4387&p=17911&hilit= ... 563#p17632
try the following

file : header-extras.php

Code: Select all

<!-- Alert Message on "DV Print Preview" -->
<script>
	function confirmPrintDV(prompt = "Are your sure you want to Print Preview?") {
		let tn = AppGini.currentTableName();
		let btn = jQuery("#dvprint").attr("data-prompt", prompt);
		let ico = btn.find("i.glyphicon").clone();
		if (tn && btn.length) btn.attr("onclick", `return ${tn}_validateData() && confirm(this.getAttribute('data-prompt'))`).text(btn.text() + "...").prepend(ico);
	}
</script>
file : TABLENAME-dv.js

Code: Select all

confirmPrintDV("Do you really want to Print Preview?");
happy coding...Have a nice day.
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.

Post Reply