Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8624307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:29:43+00:00 2026-06-12T07:29:43+00:00

very new to javascript, but any help to get me started would be appreciated.

  • 0

very new to javascript, but any help to get me started would be appreciated. I have a simple form:

<div><input type="radio" name="o1" id="burger" />Burger</div>
<div id="yesFries"><input type="checkbox" name="e1" id="fries" />Fries with that?</div>
<div><input type="radio" name="o1" id="pizza" />Pizza</div>
<div><input type="radio" name="o1" id="hotdog" />Hot Dog</div>

I want the “Fries” checkbox greyed out unless the “Burger” radio button is selected. I’m not sure if Javascript or CSS is the best way to do it. Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:29:45+00:00Added an answer on June 12, 2026 at 7:29 am

    I’ve noticed that you don’t specify whether or not you can use jQuery. If that’s an option, please see one of the other posts as I highly recommend it.

    If you cannot use jquery then try the following:

    <script>
      function setFries(){
        var el = document.getElementById("burger");
        if(el.checked)
          document.getElementById("fries").disabled = false;
        else
         document.getElementById("fries").disabled = true;    
      }  
    </script>
    
    
    <div><input type="radio" name="o1" id="burger" onchange="setFries();"/>Burger</div>
    <div id="yesFries"><input type="checkbox" name="e1" id="fries" disabled="disabled"/>Fries with that?</div>
    <div><input type="radio" name="o1" id="pizza" onchange="setFries();"/>Pizza</div>
    <div><input type="radio" name="o1" id="hotdog" onchange="setFries();"/>Hot Dog</div>​
    

    Simple example on jsFiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to javascript and raphaelJS, so sorry for my messy code, but
I know it sounds very basic, but I am new to Javascript. Here is
I have this Javascript code I inherited from another developer. I am very new
I am new to javascript so sorry I don't know very much. I have
Just started to play around with node.js, have some past experience with JavaScript but
I was looking for help last week to get a simple javascript code made
I have just started looking at javascript so hopefully this will be something simple.
I am still very new to JavaScript and jQuery. I have the jQuery add
I'm very familiar with HTML and CSS, but new to Javascript and jQuery. I
Very new to javascript and html-type stuff. I wanted to just make a quick

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.