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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:41:50+00:00 2026-05-19T17:41:50+00:00

Im reading alot of slideable data from a database, each carrying a unique id,

  • 0

Im reading alot of slideable data from a database, each carrying a unique id, for instance 18056.

So with JQuery ive made a graphical userinterface that shows a slider and a label for each slidable value that i output to the page, typical:

<html>

    <head>
        <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.9.custom.css" rel="stylesheet" />    
        <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.9.custom.min.js"></script>
        <script type="text/javascript">
            $(function(){

                $(".slider").slider({

                    range: true,
                    min: 0,
                    max: 100,
                    values: [parseInt($("#from"+(this.id).split("slider")[1]).text()), parseInt($("#to"+(this.id).split("slider")[1]).text())],

                    slide: function( event, ui ) {

                        $("#from"+this.id.split("slider")[1]).text(ui.values[0]);
                        $("#to"+this.id.split("slider")[1]).text(ui.values[1]);
                    }

                    });             
            });
        </script>
    </head>

    <body>
        <label id="from0">10</label>-<label id="to0">90</label>
        <div id="slider0" class="slider"></div>
    </body>

</html>

It says i can call split on line 15, on the values: … line 🙁 Anyone have a clue?

  • 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-05-19T17:41:50+00:00Added an answer on May 19, 2026 at 5:41 pm

    You should be using .html() and not .val()

    $(".slider").slider(
    {
     range: true,
     values: [ $("#label_"+this.id.split("slider_")[1]).html(), $("#label_"+this.id.split("slider_")[1]).html() ],
     ...
    

    But it might be better to just add your label value into the <div> like this:

    <div id="slider_18056" class="slider" data-value="10"></div>
    

    Then you can access it with $(this).attr('data-value')


    I don’t know what slider plugin you are using, but it seems like it wouldn’t be able to determine what this you want in the options. You could try this method instead:

    $(document).ready(function(){
      $(".slider").each(function(){
        $(this).slider({
          range: true,
          min: 0,
          max: 100,
          values: [parseInt($("#from"+(this.id).split("slider")[1]).text()), parseInt($("#to"+(this.id).split("slider")[1]).text())],
          slide: function( event, ui ) {
            $("#from"+this.id.split("slider")[1]).text(ui.values[0]);
            $("#to"+this.id.split("slider")[1]).text(ui.values[1]);
          }
        });
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Over the past year I have heard alot about Velocity and NVelocity. Reading their
We have a .NET object that does a lot of reading/writing with the database.
Hi I have been reading alot of articles adoring the PEAR mail package and
I've recently been reading Louis Davidson's book on Sql Server Database Design and found
I have been reading alot about functional programming and f#. I have a snippet
I've been reading a lot about closures and I think I understand them, but
I've been hearing/reading a lot about the new language enhancements for C# 4. I'm
I've been reading a lot lately about how joins in DB queries slow things
I'm reading a lot about good and bad practices in OOP design. It's nice
I've been reading through a lot of the rookie Java questions on finalize() and

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.