By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,784 Members | 3,536 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,784 IT Pros & Developers. It's quick & easy.

How do I detect which button was clicked on "save/open/cancel" dialog?

P: n/a
When users clicked a unkown mime type link such as Zip on my website, a
"Save/Open/Cancel" dialog box pops up. Is there a way to detect which button
users clicked by using ASP? actually I only what to record the "valid"
click -- when Open/Save was clicked.

Thanks ahead.

Quinn
Jul 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Quinn wrote:
When users clicked a unkown mime type link such as Zip on my website, a
"Save/Open/Cancel" dialog box pops up. Is there a way to detect which button
users clicked by using ASP? actually I only what to record the "valid"
click -- when Open/Save was clicked.

Thanks ahead.

Quinn


Look in the Request.Form collection, I believe you will get a hit on the
one that was clicked and the other two will not be in there.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Jul 22 '05 #2

P: n/a
You can't. The site just streams the file to the browser. What the user does
with the file is not known by the website as there is no more server side
interaction...

Denpending on what you are after you could perhaps let a userdo 3 attemps
wihtin a quite short period before blocking the download or something
similar...

Patrice

--

"Quinn" <qj**@yahoo.com> a écrit dans le message de
news:Ov**************@tk2msftngp13.phx.gbl...
When users clicked a unkown mime type link such as Zip on my website, a
"Save/Open/Cancel" dialog box pops up. Is there a way to detect which button users clicked by using ASP? actually I only what to record the "valid"
click -- when Open/Save was clicked.

Thanks ahead.

Quinn

Jul 22 '05 #3

P: n/a
You cannot. You can't even tell whether or not they clicked on anything at
all...

When users clicked a unkown mime type link such as Zip on my website, a
"Save/Open/Cancel" dialog box pops up. Is there a way to detect which
button users clicked by using ASP? actually I only what to record the
"valid" click -- when Open/Save was clicked.

Thanks ahead.

Quinn

Jul 22 '05 #4

P: n/a
Thanks guys.But it's too bad we cannot detect.


"Quinn" <qj**@yahoo.com> wrote in message
news:Ov**************@tk2msftngp13.phx.gbl...
When users clicked a unkown mime type link such as Zip on my website, a
"Save/Open/Cancel" dialog box pops up. Is there a way to detect which
button users clicked by using ASP? actually I only what to record the
"valid" click -- when Open/Save was clicked.

Thanks ahead.

Quinn

Jul 22 '05 #5

P: n/a
But maybe you can...?

I'm guessing here as I've not tried this, but you could try something like
this:

1 - in your form, create a hidden field <input type="hidden"
id="buttonClicked" name="buttonClicked" value="">

2 - in each button, have an onclick event to run some javascript which
passes the id/name of the button, e.g. "buttonA" <input
onclick="fnClicked(buttonA)"

3 - have a JavaScript function that selects the hidden field by ID and sets
the value of this to be the parameter received. Not that familiar with
JavaScript so the following undoubtably won't work without
editing/re-writing...

function fnClicked(IDSelected)
{
hiddenElement = document.getElementById('buttonClicked');
hiddenElement.value = IDSelected;
}

Then, when the form submits, you'll have a new input element that has the
value of the button selected.

Of course, if the punter has disabled JavaScript then it obviously won't
work.

HTH

Griff
Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.