Forum Moderators: open

Message Too Old, No Replies

pop-up sizing and information uploads

I am lost

         

fatty

10:28 pm on Jan 30, 2004 (gmt 0)

10+ Year Member



Hello,

To you who have done thise before, this will be easy. I requre/looking for 2 things.

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.

Sanenet

10:53 pm on Jan 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



check javascript.internet.com or dynamicdrive.com. Pretty sure I've seen similar scripts on these sites.

BTW, welcome to WBW!

mglind

8:03 pm on Feb 2, 2004 (gmt 0)

10+ Year Member



Most programmers use the window.open method activated by an onclick to open a new browser window. With this function you can pass in the features of the new window.

<a href="#" onclick="window.open('mypage.php','pW','width=300,height=200')">Open Window</a>

You can then access the variables of the page that opened this pop-up with window.opener.property.

So, if you have a text field (name="txt") in a form (name="frm")you can modify the value like this from the pop-up window.

window.opener.frm.txt.value = "Some text value";

Example of some code that works.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script>
function updateOpenerText(){
window.opener.frm.txt.value= "<?=$passedText?>";
}
<?
if($passedText){
echo 'updateOpenerText();';
}
?>
</script>
</head>
<body>
My opened window.
<form action="page2.htm" name="popupForm">
<input type="text" name="passedText">
<input type="submit" name="submitted">
</form>
</body>
</html>

This is the code in the pop-up window. I open this window and then post to it and if we have passed some text from within our input box the window that opened this pop-up gets updated.