gelo.salazar Posted March 7, 2011 Share Posted March 7, 2011 How can i handle what the user clicked in the Save File Dialog Box? if(user clicked "save") { i will send them an email; } else if (user clicked "cancel") { i will not send them an email; } is this possible? Please help me out guys. Thankyou Quote Link to comment https://forums.phpfreaks.com/topic/229907-how-to-handle-save-file-dialog-box/ Share on other sites More sharing options...
gristoi Posted March 7, 2011 Share Posted March 7, 2011 Hi, your request is a bit vague. Are the buttons part of a form that sends via post / get? Or a JavaScript confirm window? Quote Link to comment https://forums.phpfreaks.com/topic/229907-how-to-handle-save-file-dialog-box/#findComment-1184166 Share on other sites More sharing options...
gelo.salazar Posted March 7, 2011 Author Share Posted March 7, 2011 header('Location: Downloads/'.$path); After this happens, a save file dialog box will appear. It is a JavaScript Confirm window. Please, Badly needed Quote Link to comment https://forums.phpfreaks.com/topic/229907-how-to-handle-save-file-dialog-box/#findComment-1184172 Share on other sites More sharing options...
gristoi Posted March 7, 2011 Share Posted March 7, 2011 If it's JavaScript then try: var save = confirm('are you sure you wish to save this ..'); if (save ==true){ Window.location = http://www.URL.tosendemailfunction?send=true&id.... } else { window.location = somewhere else } Hope this gives u the general idea Quote Link to comment https://forums.phpfreaks.com/topic/229907-how-to-handle-save-file-dialog-box/#findComment-1184181 Share on other sites More sharing options...
PFMaBiSmAd Posted March 7, 2011 Share Posted March 7, 2011 It's not javascipt. It is part of the browser's user interface and you don't have any access to what choice was selected except via the fact that the file was or was not downloaded from the server. Quote Link to comment https://forums.phpfreaks.com/topic/229907-how-to-handle-save-file-dialog-box/#findComment-1184184 Share on other sites More sharing options...
gelo.salazar Posted March 7, 2011 Author Share Posted March 7, 2011 Sorry for what ive said. I thought it is a JavaScript. So what should I do now? How can i control if the file has been downloaded from the server? Quote Link to comment https://forums.phpfreaks.com/topic/229907-how-to-handle-save-file-dialog-box/#findComment-1184193 Share on other sites More sharing options...
gristoi Posted March 7, 2011 Share Posted March 7, 2011 PFMaBiSmAd is right, I am sorry, I was under the assumption you had wrote the dialog window yourself. You might want to look into taking more contol of the download aspect of your site. A good place to start is the jquery UI. Your could perhaps look at writing your open dialog window using jquery. http://docs.jquery.com/UI/Dialog Quote Link to comment https://forums.phpfreaks.com/topic/229907-how-to-handle-save-file-dialog-box/#findComment-1184202 Share on other sites More sharing options...
gelo.salazar Posted March 7, 2011 Author Share Posted March 7, 2011 Thankyou. Ill try to understand this first. Quote Link to comment https://forums.phpfreaks.com/topic/229907-how-to-handle-save-file-dialog-box/#findComment-1184229 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.