Click to See Complete Forum and Search --> : radio button won't check


rjusa
11-09-2003, 10:34 AM
I have a form that opens a child window...values are input into the child, passed on to the parent and child closes...so far so good...abbreviated code is:

function updateParent(childForm1) {
opener.document.forms[0].CndnSBSS.value = document.childForm1.cf1e.value;
if (document.childForm1.cf1a[0].checked)
opener.document.forms[0].CndnSBIrr.value="Yes";
if (document.childForm1.cf1a[1].checked)
opener.document.forms[0].CndnSBIrr.value="No";

self.close();
return false;

the last 2 "if" statements take a radio selection (child) and return the word "Yes"/"No" depending on selection to parent


Heres my problem...in case the child needs to be edited after closed I put in the following:

window.onfocus=BenPtoC
function BenPtoC() {
document.childForm1.cf1e.value=opener.document.forms[0].CndnSBSS.value;
if (opener.document.forms[0].CndnSBIrr.value=Yes)
document.childForm1.cf1a[0].checked;
if (opener.document.forms[0].CndnSBIrr.value=No)
document.childForm1.cf1a[1].checked;

when you re-open the child all the values that were passed originally to the parent are there EXCEPT the radio button is not selected...for a minute thought I was a genius! Any thoughts why the radio is not getting selected?

Thanks,
Ron

zachzach
11-09-2003, 11:19 AM
instead of .checked, do .checked == true or .checked == false, and .checked=false/true to make it that way(change it)

rjusa
11-09-2003, 08:53 PM
actually, by following your suggestion the following works:

if(opener.document.forms[0].CndnSBIrr.value=="No")
document.childForm1.cf1a[1].checked=true;

zachzach
11-10-2003, 06:35 PM
oh yes, i forgot the defualt thing when you make a statment is true so it would work..but if you were trying to uncheck it youd have to do !then the statment or the statment=false

im talking to myself LOL ;) :)