Sunday, November 29, 2009

How to return a value of a radio button in a group

Use the following function to get the value of the selected radio button in a group.

function checkRadio (frmName, radiobuttonGroupName) {
var radios = document[frmName].elements[radiobuttonGroupName];
for (var i=0; i < radios.length; i++) {
if (radios[i].checked) {
return radios[i].value;
}
}
return false;
}

selected = checkRadio (frmName, radiobuttonGroupName);

7 comments:

  1. There's definately a great deal to know about this topic. I really like all the points you made.

    my homepage holiday email templates

    ReplyDelete
  2. Hurrah, that's what I was searching for, what a material! existing here at this webpage, thanks admin of this web site.

    My web site :: Free Email invitation templates

    ReplyDelete
  3. This design is incredible! You most certainly know how to keep a reader entertained.

    Between your wit and your videos, I was almost moved to
    start my own blog (well, almost...HaHa!) Wonderful job.
    I really enjoyed what you had to say, and more than that, how
    you presented it. Too cool!

    Here is my webpage; email marketing design

    ReplyDelete
  4. Hello friends, its impressive article on the topic of tutoringand fully
    defined, keep it up all the time.

    Here is my page; makeup bridal

    ReplyDelete
  5. Hi, I do think this is a great site. I stumbledupon it ;
    ) I will revisit once again since i have book-marked it. Money and freedom
    is the best way to change, may you be rich and continue
    to guide others.

    my homepage ... email Marketing Platform

    ReplyDelete
  6. of course like your web site but you have to test the spelling on quite a few of your posts.

    Many of them are rife with spelling issues and I to
    find it very bothersome to tell the reality nevertheless
    I'll certainly come again again.

    Here is my webpage; click through the next post

    ReplyDelete
  7. My progrаmmer is trying to conνince me to
    move to .net frοm PΗΡ. I have аlwаys dislіκeԁ thе idеa beсаuse of thе expenseѕ.
    But he's tryiong none the less. I've beеn uѕing WordPгeѕs on numerous
    websitеs foг abоut a yеar and am сoncerned аbout ѕwіtching
    to anothеr platform. I hаve hеard excellеnt things аbοut blοgenginе.
    net. Ӏs there а wаy I саn іmpoгt
    all my woгdpresѕ posts into it?
    Αnу kіnd οf help woulԁ be gгeаtly appгeciаtеd!


    Μy webѕіte :: asian bridal makeup

    ReplyDelete