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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:50:45+00:00 2026-06-16T02:50:45+00:00

How to get min, max slider value from variable. When i try to slide,

  • 0

How to get min, max slider value from variable.

When i try to slide, the slider is set to maximum and stops working.

If i put in min and max in numbers instead it work just fine.

Here is a fiddle showing the issue:

<INPUT TYPE="text" CLASS="slidervalue">
<DIV CLASS="slider"></DIV>

<INPUT CLASS="getmin" TYPE="text" VALUE="1">
<INPUT CLASS="getmax" TYPE="text" VALUE="10"> 


             var getmin = $('.getmin').val();
             var getmax = $('.getmax').val();

           $(".slider").slider({

                    range: "max",
                    min: getmin,
                    max: getmax,
                    value: 2,
                    slide: function( event, ui ) {
                        $( ".slidervalue" ).val( ui.value );
                    }       

            });

http://jsfiddle.net/gk3dG/1/

  • 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-16T02:50:47+00:00Added an answer on June 16, 2026 at 2:50 am

    The jQueryUI slider expects int values, not string values. val() returns strings.

    If you do this it fixes your issues…

    var getmin = parseInt($('.getmin').val(), 10);
    var getmax = parseInt($('.getmax').val(), 10);
    

    See updated js fiddle…

    You’ll also have to handle NaN values, so you could also do this…

    var getmin = parseInt($('.getmin').val(), 10);
    var getmax = parseInt($('.getmax').val(), 10);
    
    if (isNaN(getmin)) getmin = 1;
    if (isNaN(getmax)) getmax = 10;
    

    (assuming 1 & 10 are your default values).

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

Sidebar

Related Questions

$(#storlekslider).slider({ range: max, min: 0, max: 1500, value: 0, slide: function(event, ui) { $(#storlek_testet).val(ui.value);
It is ok to set the max & min value for a UISlider control
Trying to get a jquery ui slider handle to automatically slide to a value
How to get the min and max heap size settings of a VM from
Hei friends. I've got a problem with getting the max and min value from
I'm trying to get the jQuery slider to have set values to slide to
Here I have a problem with jQuery slider, were I get min and max
I want to get max and min values with other column's values in ms
Why I can't get the min-height of an object when its parent is set
I am trying to read the value of my slider from a DIV element's

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.