hcl-bot
1
Hello all ,With a popup window, I can with javascript save the value of text fields back to the parent doc when I close the popup.
But I’m having problem with a radio button value saving to a text field on the parent form… (same with checkbox).
so this snippet…
if(dialogform.RadioButtonFieldName.value == “”)
with (dialogform.RadioButtonFieldName) {
for (f=0; f<length; f++) {
if (options[f].selected) {
hostDoc.RadioButtonFieldName.value = options[f].text
}
}
}
else
{
hostDoc.TextFieldName.value = dialogform.RadioButtonFieldName.value
}
Can anyone point me in the write direction please??
Thanks,
Brett
hcl-bot
2
Subject: Javascript in popup windows - save to parent doc
Here’s a function I use to return the value of a radio button or check box:
function getValue(sFieldName) {
var thisField = thisForm.elements[sFieldName];
var myValue = "";
for (i=0; i<thisField.length; i++) {
if (thisField[i].checked) {
myValue = thisField[i].value;
}
}
return myValue;
}
Note two things:
-
thisField[i].checked, not options[i].selected
-
thisField[i].value, not thisField[i].text
HTH …
hcl-bot
3
Subject: RE: Javascript in popup windows - save to parent doc
that was it… thanks for the hint…
if(dialogform.Territory.value == “”)
with (dialogform.Territory) {
for (h=0; h<length; h++) {
if (options[h].checked) {
hostDoc.Territory.value = options[f].value
}
}
}
else
{
hostDoc.Territory.value = dialogform.Territory.value
}