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

  • Home
  • SEARCH
  • 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 616513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:20:06+00:00 2026-05-13T18:20:06+00:00

I have several DIVs on a page. Inside these DIVs I have several form-elements

  • 0

I have several DIVs on a page.

Inside these DIVs I have several form-elements such as inputs and selects.

I also have two radio buttons.

I want whenever radio nr2 is clicked, to disable ALL OTHER ELEMENTS inside the active DIV.

Here is one of my DIVs and its content:

<div id="test">

<select name="cars_mile_to" id="cars_mile_to" style="width: 130px; margin-bottom: 5px;">

                <option id="Miltal Till" value="1000000" class="nav_option_main" selected>-- Miltal Till --</option>
                <option id="500" value="500">500</option>
                <option id="1000" value="1000">1 000</option>
                <option id="1500" value="1500">1 500</option>
                <option id="2000" value="2000">2 000</option>
                <option id="2500" value="2500">2 500</option>
                <option id="3000" value="3000">3 000</option>
                <option id="3500" value="3500">3 500</option>
                <option id="4000" value="4000">4 000</option>
                <option id="4500" value="4500">4 500</option>
                <option id="5000" value="5000">5 000</option>
                <option id="5500" value="5500">5 500</option>
                <option id="6000" value="6000">6 000</option>
                <option id="6500" value="6500">6 500</option>
                <option id="7000" value="7000">7 000</option>
                <option id="7500" value="7500">7 500</option>
                <option id="8000" value="8000">8 000</option>
                <option id="8500" value="8500">8 500</option>
                <option id="9000" value="9000">9 000</option>
                <option id="9500" value="9500">9 500</option>
                <option id="10000" value="10000">10 000</option>
                <option id="11000" value="11000">11 000</option>
                <option id="12000" value="12000">12 000</option>
                <option id="13000" value="13000">13 000</option>
                <option id="14000" value="14000">14 000</option>
                <option id="15000" value="15000">15 000</option>
                <option id="16000" value="16000">16 000</option>
                <option id="17000" value="17000">17 000</option>
                <option id="18000" value="18000">18 000</option>
                <option id="19000" value="19000">19 000</option>
                <option id="20000" value="20000">20 000</option>
                <option id="22500" value="22500">22 500</option>
                <option id="25000" value="25000">25 000</option>
                <option id="30000" value="30000">30 000</option>
                <option id="35000" value="35000">35 000</option>
                <option id="40000" value="40000">40 000</option>
                <option id="45000" value="45000">45 000</option>
                <option id="50000" value="50000">50 000</option>
                <option id="1000000" value="900000">Över 50 000</option>

              </select>

              <select name="cars_fuel" id="cars_fuel" style="width: 160px; margin-bottom: 5px;">

                <option id="Drivmedel" value="Drivmedel" class="nav_option_main" selected>-- Drivmedel --</option>
                <option id="Bensin" value="Bensin">Bensin</option>
                <option id="Diesel" value="Diesel">Diesel</option>
                <option id="Miljöbränsle" value="Miljöbränsle">Miljöbränsle</option>
                <option id="EL" value="EL">EL</option>

              </select>

              <br />

              <input type="radio" name="cars_action" id="cars_action_sell" value="Säljes" checked>
                     <font face="Arial, Helvetica, sans-serif" style="font-size:14px; font-weight:bold;">Säljes</font>
              <input type="radio" name="cars_action" id="cars_action_buy" value="Köpes">
                     <font face="Arial, Helvetica, sans-serif" style="font-size:14px; font-weight:bold;">Köpes</font> 

      </div>

I want as I mention above, that whenever the radio with the id=cars_action_buy is selected, to disable all other possible elements inside the current DIV.
Perhaps by adding a js function?

Thanks

  • 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-05-13T18:20:06+00:00Added an answer on May 13, 2026 at 6:20 pm

    In javascript you can simply use the disabled=”true” attribute. So, in the onselect handler you can do something like:

    document.getElementById('cars_mile_to').disabled = true;
    

    for each of the elements you want to disable. If they are always in the same div, then you can simply loop over the elements, ignoring the radio group.

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

Sidebar

Related Questions

I have several forms inside DIVS on my page. I have one form which
i have two divs on a page. each has several dijits. i have atoggle
I have several divs that share a common class. If one of these divs
I have a div container inside which there are several child divs with css
I have several divs on a page. They are formatted like: <div id='profile-1'></div> <div
I have a page with the several divs like: By default all are display:none,
I have a page with several div's. All of the divs have a unique
I have several hidden divs on a page , some of them having the
I'm at a standstill with this code. I have one page with several divs,
I have a page I am working with that has several hidden DIVs that

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.