Forum: Ruby on Rails Slider.js - Attemting to put values in form.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Wiley J. (Guest)
on 2006-05-20 11:41
I can't figure out how to take that value that the user has chosen in
the slider and put that into a form value. Does anybody know how to do
this?

Here is my code so far (It's pretty much directly from script.aculo.us):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
    <title>Text effects tests</title>
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/scriptaculous.js"></script>
 </script>
</head>
<body>
  <h1>Sliders</h1>
  <h2>Slider with predefined values [2,4,6,8] and a non-default range
[2,15]</h2>
<form name="myform">
 <input name="test" value="helloworld">
 <div id="track3" style="width:200px;background-color:#aaa;height:5px;">
    <div id="handle3"
style="width:5px;height:10px;background-color:#f00;"> </div>
  </div>
  <p id="debug3"> </p>
<a href="#" onClick="javascript:submit()">Submit</a>
</form>
  <script type="text/javascript">
  var v;
  // <![CDATA[
    new
Control.Slider('handle3','track3',{sliderValue:20,range:$R(1,100),
        onSlide:function(v){$('debug3').innerHTML='Percentage:
'+Math.round(v)},
        onChange:function(v){$('debug3').innerHTML='Percentage:
'+Math.round(v)}});
 // ]]>
  </script>
</body>
</html>

Any help would be appreciated!

Wiley
Thomas F. (Guest)
on 2006-05-22 14:50
(Received via mailing list)
Heya,

Please post questions on prototype/scriptaculous to the rails-
spinoffs mailing list,
see http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs for
more info.

You can also use the ruby-forum.com gateway at:
http://www.ruby-forum.com/forum/10

Cheers,
Thomas

Am 20.05.2006 um 09:41 schrieb Wiley Jacobs:

>     <title>Text effects tests</title>
>  <div id="track3" style="width:200px;background-color:#aaa;height:
>     new
> Any help would be appreciated!
>
> Wiley
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails

--
Thomas F.
wollzelle

http://www.wollzelle.com

http://www.fluxiom.com :: online digital asset management
http://script.aculo.us :: Web 2.0 JavaScript
http://mir.aculo.us :: Where no web developer has gone before
This topic is locked and can not be replied to.