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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:43:56+00:00 2026-06-15T06:43:56+00:00

I have an XML file like this <?xml version=1.0 standalone=no ?> <Reading> <Item Time=17:35>

  • 0

I have an XML file like this

<?xml version="1.0" standalone="no" ?>
<Reading>
<Item Time="17:35">
    <SlaveAddress />
    <Slave_4 Value="0" />
    <Slave_3 Value="0" />
    <Slave_2 Value="0" />
    <Slave_1 Value="1" />
</Item>
</Reading>

and my dropdownlist look like this

<select id="comboBox" style="width:100px;" tabindex="1">
 <option value=""></option>
 <option value="1">1</option>
 <option value="2">2</option>
 <option value="3">3</option>
 <option value="4">4</option>
</select>

Is it possible to grey out any of <select> <option> based on of that XML file? Meaning if Slave_1‘s value is 1 then the <option> 1 is enabled and if Slave_2 is 0 then <option> 2 is then disabled or greyed out.

Then the user can make their choice based on any enabled option.

I would love to have any input from you out there. Javascript or JQuery doesn’t matter.

  • 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-15T06:43:58+00:00Added an answer on June 15, 2026 at 6:43 am

    Something like this should do the trick. Parse the xml, mjQueryfy it, the go through it, get the correct stuff out and disable or enable as needed

    var xml = $.parseXML('your_xml_as_a_string_or_whatever');
    var $xml = $(xml);
    
    $xml.find('Item').children().each(function(index, value) {
      var $this = $(this);
      var tagName = $this.prop('tagName').toLowerCase();
      if (tagName.indexOf("slave_") === 0) {
        var value = $this.attr('Value');
        var number = tagName.slice(-1);
        if (value === '0') {
          $('option[value="'+number+'"]').attr('disabled', 'disabled');
        } else {
          $('option[value="'+number+'"]').removeAttr('disabled');
        }
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file that reads like this <abc> <ab>value</ab> <aa>time</aa> <ac>money</ac> </abc>
I have a XML file like this : <?xml version=1.0 encoding=UTF-8 standalone=no ?> <user>
I have an XML file that looks like this: <?xml version=1.0? encoding=UTF-8 standalone=no?> <dir
I have an XML File that looks like this: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
I have an XML file (diploma.xml) that looks like this: <?xml version=1.0 standalone=no ?>
I have a simple xml file that looks like this: <?xml version=1.0 encoding=UTF-8 standalone=yes
I have an XML file that looks like this: <?xml version=1.0 standalone=yes?> <NewDataSet> <DT100>
I have a XML file like this <?xml version=1.0 encoding=utf-8?> <Survey Name=Aerosmith's Survey Id=S2
I have created an xml file like this: <?xml version=1.0 encoding=utf-8?> <ListView xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent
I have an XML file looks like this: <?xml version=1.0 encoding=utf-8 ?> <PathMasks> <Mask

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.