Radio button help - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Radio button help

XfactorXfactor Posts: 343Member
Hello, I'm a beginner in JavaScript so please bear with me. I do have a lot of C/C++ programming experience so programming isn't new, just JS.
Anyway, I need help with accessing a radio button in a form in JS. I want to use an if statement to check to see if a certain button is set and I can't figure it out. I've tried looking it up in a couple books I have but it hasn't helped. Could someone please help?

Thanks,
X

Comments

  • ayanroyayanroy Posts: 15Member
    : Hello, I'm a beginner in JavaScript so please bear with me. I do have a lot of C/C++ programming experience so programming isn't new, just JS.
    : Anyway, I need help with accessing a radio button in a form in JS. I want to use an if statement to check to see if a certain button is set and I can't figure it out. I've tried looking it up in a couple books I have but it hasn't helped. Could someone please help?
    :
    : Thanks,
    : X
    :

    write document.formname.radiobuttonname[index]

    eg.

    document.myForm.radio1[0] to access the first radio button in radio button set named radio1 insie form myForm




Sign In or Register to comment.