• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Frames

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a mainpage in which i have some form elements and a submit button.On click of the button, I want to open a new window that has 2 frames. The url for the 1st frame is known, but url for 2nd depends on form input. Can someone tell me how to set the url for the 2nd frame once the window is open.
I tried this with onClick event , but doesnt help.
function setSource(newSource){
myRemote=window.open('test.html','reportWindow');
myRemote.location.href = test.html;
myRemote.frames[1].location.href=newSource;
}
Thanks
srividya
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Srividya,
I have changed your function just a little. Does this work for you?


function setSource(newSource){
myRemote=window.open('test.html','reportWindow');
// don't need this line, as location is set when the window opens
// myRemote.location.href = test.html;
myRemote.frames[1].document.location.href=newSource;
}


Alternately, you could save the "newSource" as a JavaScript variable and have the new window request it from the opener.
g.
 
Srividya Shiv
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No luck. I am getting a javascript error that myRemote.frames[1].location.href is null.
Any help please?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic