You are viewing an obsolete version of the DU website which is no longer supported by the Administrators. Visit The New DU.
Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Javascript question [View All]

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
billyskank Donating Member (1000+ posts) Send PM | Profile | Ignore Tue May-16-06 04:29 AM
Original message
Javascript question
Advertisements [?]
Edited on Tue May-16-06 04:30 AM by billyskank
I am a n00b when it comes to Javascript. What is an elegant way of checking the value of a radio group, that is, the particular button that is selected?

You group the radio buttons by giving them all the same name, and I found that when I tried to reference the group by name, all I got was the value of the first button in the group, regardless of what is selected.

The only technique I have come across so far is to iterate through all the items in the form, examine the name of each item to see if it is a member of the radio group and, if it is, examine its "checked" property.

But this seems fugly to me. Is this really the way to do it? Or am I just being a :dunce:?
Printer Friendly | Permalink |  | Top
 

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC