Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • From: peter at brunone.com (Peter Brunone)
  • Subject: [Javascript] How Do I Upload a File in One Window And Submit theForm In The Other Window?
  • Date: Mon Sep 29 22:25:05 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@xxxxxxxxxx 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