Forum Moderators: open
My program that i am making, has a hyperlink button called upload. When i click on it a pop up appears. Here is my first problem. 1) How do resize the browser so it is not the full size of the window, how can size that pop up so the broswer size is customized?.
After hte clients have uploaded thier, i want that info to be sent on the page they were in a text box without refreshing the page and sending a php code. I have seen this happen but cant find the javascript for it. I am pretty sure its javascript.
This how i wanted to work. someone clics on upload, a pop up appears with upload capability. The pop up will be small and not fulll sized. Then after they upload a code from the pop up will go to the previous page and insert itself into the text box.
Is there a way to do this.
var popupWindow;
function doPopup()
{
popupWindow=window.open('http://www.domain.com/popup.html','Popup Title',"height=300,width=550,resizable=no,status=no,scrollbars=no,location=no,menubar=no,toolbar=no");
popupWindow.parent=this; // set the parent window
}
To do the focus/fill in the text box thing, you need these functions defined in the parent document :
function findById(id) {
if (!document.getElementById) { return document.id; }
else { return document.getElementById(id); }
}
function onPopupClose(textValue) {
findById('my_text_box').innerHTML=textValue;
popupWindow.close();
findById('my_text_box').focus();
}
The in when your upload is complete, output this code from your php script.
<body onLoad="parent.onPopupClose('php code');">
</body>
Hope that helps.
-Chris