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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Button Values

Status
Not open for further replies.

varnix

Programmer
Jan 7, 2002
94
US
I'm using some JavaScript to open a child window for data verification purposes before my user completes a form.

I have 2 fields that are passed to this child window, one is a text field, the other a radio button:

<form name=&quot;myform&quot;>
<input type=&quot;text&quot; name=&quot;enum&quot;>
<input type =&quot;radio&quot; name=&quot;division&quot; value=&quot;1&quot;>
<input type =&quot;radio&quot; name=&quot;division&quot; value=&quot;2&quot;>
<input type =&quot;radio&quot; name=&quot;division&quot; value=&quot;3&quot;>
<input type=&quot;button&quot; name=&quot;Check Data&quot; onclick=&quot;javascript:child_window()&quot;>


With a function called 'child_window' defined elsewhere in the script that looks similar to:

function child_window() {
var chk_enum=document.myform.enum.value;
var chk_dvsn=document.myform.division.value;

window.open(blah,blah)
}

The window that gets opened is a Coldfusion page with the values passed as url values.

The problem that I am experiencing is that no matter what I do, I can't get the radio button value to pass across. The text field goes just fine.

As an added layer of difficulty I need this to function in both IE *and* Netscape.

Thanks!
 
Does this help at all: faq216-3388

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
to get the value from the radio group in script, you probabluy have to do this...

function child_window() {
var chk_enum=document.myform.enum.value;
for (x=0; x<document.myform.division.length; x++){
if (document.myform.division[x].checked){
var chk_dvsn=document.myform.division[x].value;
}
}
window.open(blah,blah)
}


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Thanks for the assists!

Actually managed to figure it out on my own, but I didn't receive your notifications because our spam blocker was blocking msgs from the group!

IF the msg had gotten through I'd have more hair this morning! Oh well! :)

Have our engineering group clearing up that issue!

Can't have tek-tips being blocked!

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top