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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:59:07+00:00 2026-06-07T23:59:07+00:00

Hei friends. I’ve got a problem with getting the max and min value from

  • 0

Hei friends.
I’ve got a problem with getting the max and min value from select box(html).
I want to get MAX AND MIN value from selectbox with jquery or javascript.

Here is the markup, simple range slider.

$('#slider').slider({
        range: true,
        min: 0,//HERE I WANT TO GET VALUES
        max: 40,
        step: 10, // Use this determine the amount of each interval
        values: [ 20, 40 ], // The default range
        slide: function( event, ui ) {
          // for input text box
          $( "#amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] );
          // Display and selected the min Price
          $( "#my_min" ).val(ui.values[ 0 ]);
          // Display and selected the max Price 
          $( "#my_max" ).val(ui.values[ 1 ]); 
    }
});

I want to get them from the select box, select box will be dynamicly filled by PHP.
Here is the code:

<select id="my_min" class="price_range">
<?php //dynamicly filled options 

         while($row=mysql_fetch_array($query))
            {echo "<option>".$row['values']."</option>";}


?>
</select>

Thanks for help.

  • 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-07T23:59:09+00:00Added an answer on June 7, 2026 at 11:59 pm

    Your question is ambiguous. Two ways of interpreting:

    1. You want javascript to know the min and max value of the selectbox.

    You can use:

     var options = document.getElementById('yourselectbox').childNodes;
     var min = 999999999;
     var max = 0;
     for(var i = 0; i < options.length; i++) {
         if(options[i].value > max) max = options[i].value;
         if(options[i].value < min) min = options[i].value;
     }
    

    2. You want the server to know javascripts max and min value.

    The DOM is built by the server, i.e. it builds the HTML. The HTML includes the javascript which defines the min value and the max value. When data is sent back to the server via a POST, only the SET value will be send. Normally, the min and max value won’t matter to the server. If you want the min and max values to be sent, you have to make hidden input fields containing those values. However, why would you? You define the min and max value don’t you?

    — edit —

    var options = document.getElementById('yourselectbox').childNodes;
    var min = 999999999;
    var max = 0;
    for(var i = 0; i < options.length; i++) {
        if(options[i].value > max) max = options[i].value;
        if(options[i].value < min) min = options[i].value;
    }
    $('#slider').slider({
            range: true,
            min: min,
            max: max,
            step: 10, // Use this determine the amount of each interval
            values: [ 20, 40 ], // The default range
            slide: function( event, ui ) {
              // for input text box
              $( "#amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] );
              // Display and selected the min Price
              $( "#my_min" ).val(ui.values[ 0 ]);
              // Display and selected the max Price 
              $( "#my_max" ).val(ui.values[ 1 ]); 
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hei , Following is my html code and css . I dont want to
Hei guys, I'm trying to load a long text from a .rtf file and
hei, Using Linq to SQL (ala NorthWind database for example): How to select all
Hei guys, I have the following problem: As I can see those arrows are
Hei , I'm trying to verify if my username and password from my xml
hei. the language is java. i want to extend this class which the constructor
A list is created dynamically. Now I want to get 93 or 94 etc
Hei guys i have this JQuery Ajax call from my view and it looks
Hei, I have a method from a class in a custom library which I
Hei! I have an image and on that image I'd like to select a

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.