Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in passing values from child window to parent window

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two windows - Parent and Child. WHen I click on a button in the parent window, the child window opens up.

The child window has two radio buttons and a submit button. On click of the submit button, I want the value to be passed to the parent window and the child window shd close.

Depending upon the value from the child window, the parent window should be redirected to the new URL.

I get the error in child window as :

document.frmHolidayType.rdoHoliday.selected.value is null or not an object.

Can anybody plz help!
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is that field in the parent?

then you need to do

window.opener.formName.elementName.value = "asdf";

Eric
 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, this field is in the child window.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh, duh, should have looked at your code more closely.

document.frmHolidayType.rdoHoliday.selected.value

that is not how you get a radio button value

this is:


Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic