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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:30:53+00:00 2026-06-01T02:30:53+00:00

I have the following JQuery function about a range slider . It’s just working

  • 0

I have the following JQuery function about a range slider. It’s just working fine.

<script type="text/javascript">
    jQuery(function() {         

        jQuery("#slider-range").slider({
            range: true,            
            min: 55, 
            max: 50000,
            values: [55, 50000],
            slide: function(event, ui) {
                jQuery("#minValue").val(ui.values[0]);
                jQuery("#maxValue").val(ui.values[1]);
            }
        });
        jQuery("#minValue").val(jQuery("#slider-range").slider("values", 0));
        jQuery("#maxValue").val(jQuery("#slider-range").slider("values", 1));
});
</script>

Now, I need to pass the values of max and min within the function dynamically at run time from MySql database that indicate the range of the slider.

I have tried to set those values by using hidden fields something like the following.

<script type="text/javascript">
    jQuery(function() {         

     var mini=document.getElementById("hid_min_price").value;
     var maxi=document.getElementById("hid_max_price").value; 

        jQuery("#slider-range").slider({
            range: true,            
            min: mini, 
            max: maxi,
            values: [mini, maxi],
            slide: function(event, ui) {
                jQuery("#minValue").val(ui.values[0]);
                jQuery("#maxValue").val(ui.values[1]);
            }
        });
        jQuery("#minValue").val(jQuery("#slider-range").slider("values", 0));
        jQuery("#maxValue").val(jQuery("#slider-range").slider("values", 1));
});
</script>

but it isn’t working. How can then I set the values of max and min dynamically at run time?

  • 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-01T02:30:54+00:00Added an answer on June 1, 2026 at 2:30 am

    You could fetch min max values from database and then assign them to javascript variables inside of the tag.

    Let’s assume you’re using php, the code would look something like that:

    …

    echo '
    <script type="text/javascript">
        jQuery(function() {         
    
            var mini='.$min.';
            var maxi='.$max.';
    
            jQuery("#slider-range").slider({
                range: true,            
                min: mini, 
                max: maxi,
                values: [mini, maxi],
                slide: function(event, ui) {
                    jQuery("#minValue").val(ui.values[0]);
                    jQuery("#maxValue").val(ui.values[1]);
                }
            });
            jQuery("#minValue").val(jQuery("#slider-range").slider("values", 0));
            jQuery("#maxValue").val(jQuery("#slider-range").slider("values", 1));
    });
    </script>';
    

    …

    Where $min and $max contian data from DB.

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

Sidebar

Related Questions

I have the following jquery function > <script type=text/javascript> > > $(document).ready(function() { >
Morning all. I have the following javascript in my code in front <script type=text/javascript
I have the following function that opens jQuery UI's dialog warning about the delete
I have the following jQuery function (simplified): function doSomething(el, str) { el.find('.class').text(str)); } Don't
I have the following page : <html> <head> <link type=text/css href=css/smoothness/jquery-ui-1.8.14.custom.css rel=stylesheet /> <style
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have the following jquery function for filtering the contents of a listbox on
I have the following jQuery function: $(function(){ if ($(.menu li).hasClass(active)) { $(.active).css(margin-top, 6px); }
I have the following scenario jQuery('#content').fadeOut('slow',function(){ jQuery('#content').load(detail.php?product=+imgID+&category=+cat); jQuery('#content').fadeIn('fast'); }); My problem however is that
I have the following jQuery: $(document).ready(function () { $(.element).draggable(); $(.element).droppable({ drop: function () {

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.