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 7545767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:00:56+00:00 2026-05-30T09:00:56+00:00

I’m making a custom computer builder for my site like you see on dell

  • 0

I’m making a custom computer builder for my site like you see on dell and the likes.

Basically you can choose you processor, the html for them look like this:

<div class="process_intel_options" style="display:block">
    <label class="option">
        <input type="radio" name="processor_options" value="124" data-price="195.82"  data-socket="1366"  class="calculation-item"  id="intel_options_0" checked="checked"  />
        Intel Core i7 960 3.20Ghz (Nehalem) <span class="item_price positive">+0</span> </label>
    <br />
    <label class="option">
        <input type="radio" name="processor_options" value="149" data-price="250.00"  data-socket="1155"  class="calculation-item"  />
        Processor socket 1155 <span class="item_price positive">+0</span> </label>
    <br />
    <label class="option">
        <input type="radio" name="processor_options" value="125" data-price="359.99"  data-socket="1366"  class="calculation-item"  />
        Intel Core i7 980 3.33Ghz (Gulftown) <span class="item_price positive">+0</span> </label>
    <br />
</div>
<div class="process_amd_options" style="display:none">
    <label class="option">
        <input type="radio" name="processor_options" value="126" data-price="133.32"  data-socket="am3"  class="calculation-item"  id="amd_options_0"  />
        AMD Bulldozer FX-8 Eight Core 8120 3.10Ghz <span class="item_price positive">+0</span> </label>
    <br />
    <label class="option">
        <input type="radio" name="processor_options" value="127" data-price="162.99"  data-socket="am3"  class="calculation-item"  />
        AMD Bulldozer FX-8 Eight Core 8150 3.60Ghz <span class="item_price positive">+0</span> </label>
</div>

Notice the attribute data-socket.

You can then select the motherboard:

<div class="mobo_options">
    <label class="option">
        <input type="radio" name="motherboard_options" value="145" data-price="178.00" data-socket="1155"  class="calculation-item"  id="mobo_options_0" checked="checked"  />
        Motherboard 1 socket 1155 <span class="item_price positive">+0</span> </label>
    <br />
    <label class="option">
        <input type="radio" name="motherboard_options" value="146" data-price="180.00" data-socket="1155"  class="calculation-item"  />
        Motherboard 2 socket 1155 <span class="item_price positive">+0</span> </label>
    <br />
    <label class="option">
        <input type="radio" name="motherboard_options" value="147" data-price="190.00" data-socket="1366"  class="calculation-item"  />
        Motherboard 3 socket 1366 <span class="item_price positive">+0</span> </label>
    <br />
    <label class="option">
        <input type="radio" name="motherboard_options" value="148" data-price="200.00" data-socket="2011"  class="calculation-item"  />
        Motherboard 4 socket 2011 <span class="item_price positive">+0</span> </label>
    <br />
</div>

This also has data-socket.

I’m looking for a query script that will only show the motherboards that have the correct socket type as the processors, for example, if a processor is selected with data-socket="1155" then only motherboards with data-socket="1155" will be shown (also the first one needs to be selected in case they select a different processor.

Can anyone help me?

  • 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-30T09:00:58+00:00Added an answer on May 30, 2026 at 9:00 am

    Something like this should do it:

    $('input:radio[name="processor_options"]').change(function(e) {
        var socket = $(this).data('socket');
        $('div.mobo_options input:radio[data-socket!="' + socket + '"]').hide();
        $('div.mobo_options input:radio[data-socket="' + socket + '"]').show().get(0).checked = true;
    });
    

    Note that it only hides the <input type="radio"> elements, not the text that accompanies them. You might want to wrap it in another element (such as an <li> inside an <ul>) that you could hide instead, so the accompanying text is hidden as well.

    DEMO


    Just noticed you have the <input> elements wrapped in <label> elements, so you could use the following code instead to hide the text as well:

    $('input:radio[name="processor_options"]').change(function(e) {
        var socket = $(this).data('socket');
        $('div.mobo_options input:radio[data-socket!="' + socket + '"]').closest('label').hide();
        $('div.mobo_options input:radio[data-socket="' + socket + '"]').closest('label').show().end().get(0).checked = true;
    });
    

    Updated DEMO

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.