JavaScript: Get RadioButtonList Selection

Please see my other JavaScript articles.

Using JavaScript to determine selections.

First, I’ll begin with a simple radiobuttonlist control.



Though the control is itself simple to deploy and use with C#, the html that’s rendered is anything but simple.
You may overcome the difficulty of determining which radiobutton in the list is selected by utilizing the HTML input attribute within a JQuery statement.
Since all the radiobuttons within the list share the same name – “rbl_choices,” I need a statement which will determine for me which one is selected and return its id.
If the first radiobutton is selected, the value returned would be “rbl_choices_0,” otherwise it would be “rbl_choices_0.”


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s