0

I'm writing a form that will include a place to upload a pdf. I would like the upload section to be a separate form in a popup. After the user successfully uploads a file I want the original form/window to update with a link to the uploaded file and a button to change the file (upload a new file).

I'm basically stuck on the communication between the windows. I was attempting to run a javascript function on the body load of the form action script that would modify the html of the original window. Is this possible or is there some other method that would work better?

Thanks,
David

2
Contributors
6
Replies
8
Views
7 Years
Discussion Span
Last Post by zeah
0

I figured it out!
For anyone else interested:

opener.document.getElementById('htmlID').innerHTML="Blah Blah"

This will modify the window that opened a popup

Edited by nizuya: n/a

0

Hey i was trying to do exactly the same thing..
i google on this thread...can you brief me on how to go about it.
Thanks

Regards,
ZeAh

0

Just as you can use

document.getElementById('htmlID')

to manipulate html objects on your page you can use

opener.document.getElementById('htmlID')

to manipulate the objects in the window from which a popup was opened.

Likewise, when you open a popup you can give the window object a reference variable like so:

popupWindow = window.open('url','windowName','options')

You can then manipulate html objects on that page via

popupWindow.document.getElementById('htmlID')

Is this enough info? Or were you looking for more specific instruction on the whole process?

0

thanks for the post..
i created the a popup uploader form and added uploading functionality to it..
but i was not able to perform the last step on the url
http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html

where i have to get result back on the iframe...and one more thing..how do i automatically close the popup window when the uploading is completed..
thanks

Regards,
ZeAh

0

Sorry but I'm not quite sure about the tutorial. I'm not that good with javascript.

As far automatically closing I would think that at the end of your code you could put in:

<script language="javascript">
window.onload = window.close();
</script>

You would just have to make sure it's after all the other code.

Edited by nizuya: n/a

0

Thanks Nizuya..tweaking a little on the code worked..made a pop up that uploads the file and closes..still have to work on the replacing or deleting the file option..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.