...

View Full Version : Pop up screen when the user clicks to download



onqun
12-02-2009, 11:46 PM
Hello I want to add something to my web site. when the user clicks to download. i want to see a pop up screen which says your download has started.

<script type="text/javascript">
function show_alert()
{
alert("Your Download Started!");
}
</script>

<input type="button" onclick="show_alert()" onclick="get value="Download" />

I dont get where should i put the download link

Old Pedant
12-03-2009, 01:28 AM
Something like this, maybe?


<a href="/path/to/downloadfile.pdf" onclick="alert('Your download should start now'); return true;">
Download all the good stuff
</a>

Old Pedant
12-03-2009, 01:29 AM
Ahhh...but wait! The user would have to click on the OK button of the alert before the download would start. Is that what you want? Or you want both to happen at same time?

onqun
12-04-2009, 02:40 AM
no, he clicks and it ust warns that download started this logic should work let me see thank you=)

onqun
12-04-2009, 02:44 AM
There is no download link in here :/?

onqun
12-04-2009, 02:56 AM
My dear friend I made the code like this
<a href="files.me.com/ongun/b4sll8" onclick="show_alert();"><input name="Download" type="button" value="Download" /></a>

It does not download anything

glenngv
12-04-2009, 04:02 AM
Because your code is wrong. You cannot put a button inside a link and expect the button to work as a link.

If you want it as a button:

<input type="button" value="Download" onclick="show_alert(); location.href='files.me.com/ongun/b4sll8';" />

If you want it as a link:

<a href="files.me.com/ongun/b4sll8" onclick="show_alert();">Download</a>

onqun
12-04-2009, 06:05 PM
Thank you very much Glenn, but there is no download started here

glenngv
12-04-2009, 09:57 PM
You mean the "Your Download Started!" alert did not appear or the browser's download dialog did not appear?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum