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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:16:37+00:00 2026-06-06T16:16:37+00:00

I have a slider with values 1 – 5. it updates a hidden input

  • 0

I have a slider with values 1 – 5. it updates a hidden input with the ID of ‘days’.

$(function() {
    $("#slider").slider({
        value: 3,
        min: 1,
        max: 5,
        step: 1,
        slide: function(event, ui) {
            $("#days").val(ui.value);
        }
    });
    $("#days").val($("#slider").slider("value"));
});​

I want to add labels to the slider

so at position 1 it would say 1 hour, 2 would say 12 hours, 3 would say 1 day, 4 = 3 days and 5 = 1 week.

but i want to keep the value of days as 1 -5

how is this possible?

EDIT

Want to copy this
slider example

  • 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-06T16:16:39+00:00Added an answer on June 6, 2026 at 4:16 pm

    Just arrange your label container (e.g. I added a div) and when you slide, update it.

    Live version : http://jsfiddle.net/8ek4a/5/

    Code :

    $(function() {
       var labelArr = new Array("", "1 hour", "12 hours", "1 day", "3 day", "1 week");
       $( "#slider" ).slider({
           value:3,
           min: 1,
           max: 5,
           step: 1,
           slide: function( event, ui ) {
              $( "#days" ).val( ui.value );
              $("#label").html(labelArr[ui.value]);
           }
       });
       $( "#days" ).val($( "#slider" ).slider( "value" ) );
       $("#label").html(labelArr[$( "#slider" ).slider( "value" )]);
    });​
    

    UPDATE:
    Now I have come up with this solution to implement indicator. see http://jsfiddle.net/8ek4a/6/

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

Sidebar

Related Questions

Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
I have a jQuery UI slider: $('div.slider').slider({ range: true, step: 250, min: 1000, max:
I have a range slider on my site for min-max price ranges. On either
I have 4 values in UISlider . I want that when the slider value
I'm trying to get the jQuery slider to have set values to slide to
I have a slider element in my windows phone app which has min value=1
I have a slider that returns values from 0.0f to 1.0f. I want to
I'd like to have a slider (lets say values from 0 to 4) and
I want to make a GUI have a slider, this slider's value will be
Hi guys I have made a JqueryUI simple slider,on certain value range I make

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.