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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:51:35+00:00 2026-06-03T16:51:35+00:00

I have a drop down that I need to compare the values ( the

  • 0

I have a drop down that I need to compare the values (the balance) inside of the drop down and compare this to a global variable, then performing an if / else statement to display some HTML.

Here is the drop down:

 <select name="batch">
 <option value='null'>-- None --</option>
 <option value='96'>Check (#2200) (Bal. $84.00) - Jim Jones</option>
 <option value='98'>Credit Card (#0) (Bal. $90.00) - Bailey Adams</option>
 </select>

Here is my jquery:

    $("select[name=batch]").change(function () {
    if ($(this).val() >= GlobalTotal) {
        $("th#show_refund").show();
        $("th#no_show_refund").hide();
    } else {
        $("th#show_refund").hide();
        $("th#no_show_refund").show();
    }
});

Is it possible for jquery to ascertain what the balance is inside the HTML select? If so I appreciate a pointer to get me going in the right direction.

  • 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-03T16:51:38+00:00Added an answer on June 3, 2026 at 4:51 pm

    I assume you are constructing this dynamically. On each option, add an attribute data-balance=84 or whatever the balance is, then using jQuery, you would use

    $("select[name=batch] option:selected").attr("data-balance")
    

    So, your complete code would be:

    <select name="batch">
        <option value='null'>-- None --</option>
        <option value='96' data-balance="84.00">Check (#2200) (Bal. $84.00) - Jim Jones</option>
        <option value='98' data-balance="90.00">Credit Card (#0) (Bal. $90.00) - Bailey Adams</option>
    </select>
    
    $("select[name=batch]").change(function () {
        if ($("select[name=batch] option:selected").attr("data-balance") >= GlobalTotal) {
            $("th#show_refund").show();
            $("th#no_show_refund").hide();
        } else {
            $("th#show_refund").hide();
            $("th#no_show_refund").show();
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a drop down list that has options that need to be passed
I have a drop down menu that looks like this: It works fine, but
I have this drop down menu that when one menu is clicked if there
I need to make tabs that also have drop down menu and requirements are
I have a drop down list that I need to react to asynchronously. I
I have a drop-down and need to show hidden div that corresponds to the
I have a drop down that filters a multi-select box that then the user
I need to have a drop-down menu that allows you to select a year
I have a range of items in an HTML drop-down menu that I need
I have a drop-down list that I need to capture the value of when

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.