Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Detect and Delay


Message #1 by "Claudio Pallone" <pallone@l...> on Thu, 13 Feb 2003 20:21:54
Hi Len,

Thanks for you help. However, I am not using a form as you thought. I am 
looking for a delay in executing this code only:

parent.frames["toolbar"].location.reload();

There isn't any button in a form. The button I mentioned is created 
dynamically when the dialog box apperas giving the option for the user to 
save a file to his computer. Basically I am forcing a file to be 
downloaded as report.csv (comma delimited file).

So, how would I delay the execution of this code independently of any 
button? I guess I would have to write the delay before the code. Something 
like this:

setTimeout for 3 seconds - then

execute this code

parent.frames["toolbar"].location.reload();

Is it possible to do that? any ideas??

Cheers,

Claudio



> I believe you are looking for a delay before you execute a
function...like:
prepareToSubmit() {
	setTimeout(form.submit()', 20);
	parent.frames["toolbar"].location.reload();
}

Have the button not submit, but call the above function?! Sorry, no time
to read your question through.

Best Regards=20
Len Nagy=20
Lead systems architect=20
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
-- Benjamin Franklin, Historical Review of Pennsylvania, 1759


-----Original Message-----
From: Claudio Pallone [mailto:pallone@l...]=20
Sent: Thursday, February 13, 2003 3:22 PM
To: JavaScript HowTo
Subject: [javascript_howto] Detect and Delay

Hi,=20

Maybe my previous message was not clear. So I wil try again.

A dialog box is presented to the user so that he can save a file to his=20
computer. There are 3 buttons:

SAVE CANCEL (I can not remember the third one sorry)!

Is it possible to detect when the user clicks the SAVE button?

Also,

I can not figure out how to use Javascript to force the code below to
wait=20
for 3 seconds before it is executed:

parent.frames["toolbar"].location.reload();


This is the code I am using to generate the Dialog box But this code is=20
working fine:


strFileSave =3D strRptName + ".csv"
' Write out content-type that will FORCE user to SAVE FILE.
Response.ContentType =3D "text/csv"
' Tell Browser what the file name is, so it doesn't try to save original

name
Response.AddHeader("Content-Disposition","attachment; filename=3D""" &=20
strFileSave & """")

Cheers,

Claudio
---
Change your mail options at http://p2p.wrox.com/manager.asp or=20
to unsubscribe send a blank email to


  Return to Index