Results 1 to 1 of 1

Thread: Jquery slider interacting with textbox

  1. #1
    Join Date
    May 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Jquery slider interacting with textbox

    I am developing a vertical jquery slider. I am able to fetch the value of slider in a text box.
    I want to move the slider by typing in the values into the text box. any suggestion. Below is my code

    Code:
      <script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
        <script src="js/jquery-ui.min.js"></script>
        <link href="css/jquery-ui.css" rel="stylesheet" type="text/css"/>  
    
    </head>
    <body style="margin:300px;">
                 <form name="tvfinder-pricerange">
                <input type="text" id="amount" /> - <input type="text" id="amount1" />
                </form>
                <br><br />
                <div id="slider-range" style="height:250px;" ></div>
    
    </body>
    </html>
    <script language="javascript">
    $(function() {
            $("#slider-range").slider({
                range: true,
                orientation: "vertical",
                min: 1,
                max: 3000,
                values: [0, 3000],
                slide: function(event, ui) {
                    $("#amount").val('$' + ui.values[0]);
                    $("#amount1").val('$' + ui.values[1]);
                }
            });
            $("#amount1").val('$' + $("#slider-range").slider("values", 1    ));
            $("#amount").val('$' + $("#slider-range").slider("values", 0));      
        });
    </script>
    Last edited by jscheuer1; 05-14-2010 at 03:09 PM. Reason: format code

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •