Click here to Skip to main content
15,885,906 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I use html javascript and fusion 2.5

Iry to use cookies to send action around the app.

1. Are the diffrent between the input slider correct?
2. When change one value and go back to another slider it mess up my counter with wrong value like the another sliders value?

3. this.value seems to be look alike both places. It seem it take the other value!


<div>
<input id="slide" type="range" min="1" max="60" step="1" value="25" onchange="updateSlider1(this.value)">
<div id="sliderAmount1"></div>
</div>
  
<div>
<input id="slide" type="range" min="1" max="300" step="1" value="125" onchange="updateSlider(this.value)">
<div id="sliderAmount"></div>
</div>



    function updateSlider(slideAmount) {
        var sliderDiv = document.getElementById("sliderAmount");
        sliderDiv.innerHTML = slideAmount;
		 document.cookie="bpmvol=" + slideAmount;
	  
    }
	
    function updateSlider1(slideAmount1) {
        var sliderDiv1 = document.getElementById("sliderAmount1");
        sliderDiv1.innerHTML = slideAmount1;
			document.cookie="vol=" + slideAmount1;
		
    }


What I have tried:

I have tried everything

Seem the everything is ok until you navigte in input slider more than 2 times
Posted
Comments
gggustafson 15-Jul-22 16:41pm    
1. Don't use the same identifier (id="slide") for two elements.
2. Where are the cookies used?
Mark Rene Jensen 15-Jul-22 21:23pm    
1.ok thanks
2. document.cookie="bpmvol=" + slideAmount; document.cookie="vol=" + slideAmount1; they go to 2 diffrent counters in fusion 2.5. I can read the cookie from there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900