Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating "main" page after pop-up window

Status
Not open for further replies.

zoomby

Programmer
Aug 5, 2002
60
0
0
DE
hi!

how can I update a main browser window, after I opened a new window. It should work like a dialog window, which gets user input and then updates the content of the main (parent) window.

bye
chris
 
<Script language=&quot;Javascript&quot;>
function load(file,target) {
if (target != '')
{ target.window.location.href = file;
target.window.focus()
}
}
</script>
<a onclick=&quot;load('somwhere.htm',top.opener)&quot; href=&quot;#&quot;>click here</a>

This works however im not sure how to modify it so if parent page does not exist it opens in new window any ideas?

Regards Angus Grant,

http\\
 
main.htm
<script>
function openWin(){
window.open(&quot;sub.htm&quot;,&quot;&quot;,&quot;&quot;)
}
</script>
<body onLoad=&quot;openWin()&quot;>
<form name=&quot;myForm&quot;>
<input name=&quot;myField&quot; readonly>
</form>



sub.htm
<script>
function update(){
window.opener.myForm.myField.value = document.subForm.subField.value
window.opener.focus()
window.opener.alert(&quot;updated&quot;)
self.close()
}
<form name=&quot;subForm&quot;>
<input name=&quot;subField&quot;>
<input type=button onClick=&quot;update()&quot; value=&quot;Send It&quot;> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top