Note that there are some explanatory texts on larger screens.

plurals
  1. POOnchange event used with jquery slider
    primarykey
    data
    text
    <p>I'm using a jquery slider add-on that when it is manipulated, it writes the value to a linux file. </p> <p>The Slider controls a text input box. The box is readonly, so it is always blurred. The problem I can't understand is why the onchange command will not work. If I remove the readonly attribute on my input command, I run into the same problem. </p> <p>I know that my javascript function works, because I can change the value of the text input box and press enter and it will update. But what I need it to do is to update the number whenever the slider changes it, so I can't use the keyup or keydown command, because a slider controls it, not the user's input.</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $( "#LeftRecordSlider" ).slider({ range: "min", orientation: "vertical", value: 50, min: 0, max: 100, slide: function( event, ui ) { $( "#LeftRecordAmount" ).val( ui.value ); } }); $( "#LeftRecordAmount" ).val( $( "#LeftRecordSlider" ).slider( "value" ) ); }); &lt;/script&gt; &lt;script type="text/javascript"&gt; function ChangeVolume(volumetype,volumelevel) { var xmlhttp; if (window.XMLHttpRequest) {//IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {//IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("VolumeOutput").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","ChangeVolume.php?volumetype="+volumetype+"&amp;volumelevel="+volumelevel,true); xmlhttp.send(); }; &lt;/script&gt; &lt;label for="LeftRecordAmount"&gt;Left Record Volume:&lt;/label&gt; &lt;input type="text" onchange="ChangeVolume('LeftRecord',this.value)" id="LeftRecordAmount" style="border:0; width:3em; color:#0080ff; font-weight:bold;" readonly/&gt; &lt;div id="VolumeOutput"&gt;&lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload