[Javascript] How Do I Upload a File in One Window And Submit theForm In The Other Window?

Peter Brunone peter at brunone.com
Mon Sep 29 22:26:14 CDT 2003


Dan,

	First, read up on the window.open function (example in View
Source at http://aspalliance.com/peterbrunone/chatroom.asp ).  This will
open the window you need, and you can specify the URL of the form in the
opened window.

	In the new window, create a form with one element of type
"file".  This will enable the user to browse the local hard drive(s) for
a file.

	To make the form submit to the parent window, you might have to
script a special submit button that looks something like this:

<input type="button" value="Submit Now"
onClick="this.form.target=window.opener;this.form.submit();">

	Let us know how this works out, or if you need more help.

Cheers,

Peter

-----Original Message-----
From: javascript-bounces at LaTech.edu On Behalf Of Dan Anderson

I have a web page where I want the user to click a button to see a pop
up window where they can browse files on their computer to upload and
then when they click the submit button have the popup close and the form
to be submitted to the main window.

How would I go about doing this?

Thanks in advance,

Dan





More information about the Javascript mailing list