Radio Buttons - Need JavaScript to tell which one is cheched please!!
Help,
I saw the tutorial on how to see which menu item was selected from a drop down menu, I cant seem to figure the script to do this when trying to determine which radio button a user selects on my form.
I would appreciate any and/or all suggestions. Thanks
John Pollock posted this at 16:04 — 11th October 1999.
He has: 628 posts
Joined: Mar 1999
I don't remember off hand. I'll try to look it up. If anyone knows this before I get back, please post it here.
Anonymous posted this at 01:22 — 12th October 1999.
They have: 5,633 posts
Joined: Jan 1970
function findSelectedRadio() {
for (i=0; i<document.FORM.RADIO.length; i++) {
if (document.FORM.RADIO[i].checked) {
return i;
}
}
}
alert(findSelectedRadio());
----------
[email protected]
http://go.to/hass
JP Stones posted this at 01:31 — 12th October 1999.
They have: 2,390 posts
Joined: Nov 1998
Lloyd, would you be interested in co-moderating this forum as John is currently very busy.
JP
----------
[red]The Next Step in Website Development [/red] - http://www.what-next.com
The Webmaster Promotion and Resource Center
zman posted this at 03:54 — 12th October 1999.
They have: 11 posts
Joined: Sep 1999
Thank you VERY much lloyd, I have been stuck on that one for two days.
I was using document.forms[0].elements[0].checked
Anonymous posted this at 17:08 — 12th October 1999.
They have: 5,633 posts
Joined: Jan 1970
<zman>
Glad to be a help. Those radio buttons can be a bit misleading at times - I searched for the very same answer but I can assure you it took longer than two days to find the solution.
<JP>
I received an email from John and have sent a reply. I am interested and if you would like to speak to me about it, please email me.
----------
[email protected]
http://go.to/hass
John Pollock posted this at 20:48 — 12th October 1999.
He has: 628 posts
Joined: Mar 1999
It's pretty interesting how our names are so similar. We could really confuse some people if we wanted to.
I'll second the motion for Lloyd as co-moderator. Lloyd has been a big help to me, especially with the JavaScript forms and such.
Java Script: A Beginner's Guide
Page Resource
JP Stones posted this at 22:01 — 12th October 1999.
They have: 2,390 posts
Joined: Nov 1998
Just to avoid any confusion:
John Stones = JP (I sent you the email from my work address)
John Pllock is the moderator of these forums.
JP
----------
[red]The Next Step in Website Development [/red] - http://www.what-next.com
The Webmaster Promotion and Resource Center
Anonymous posted this at 01:00 — 13th October 1999.
They have: 5,633 posts
Joined: Jan 1970
<JP Stones>
I realise that now!
JP Stones posted this at 02:46 — 13th October 1999.
They have: 2,390 posts
Joined: Nov 1998
John, euh, JP
----------
[red]The Next Step in Website Development [/red] - http://www.what-next.com
The Webmaster Promotion and Resource Center
JP Stones posted this at 03:09 — 14th October 1999.
They have: 2,390 posts
Joined: Nov 1998
Llyod has agreed to come on board as co moderator, so I hope everyone gives him a good TWF welcome with loads of ridiculously hard questions
Welcome aboard!
JP
----------
[red]The Next Step in Website Development [/red] - http://www.what-next.com
The Webmaster Promotion and Resource Center
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.