I am using slideToggle in a web form. The intended result is to have a checkbox that, when checked, reveals more nested options. Every nested option should be hidden by default. This works some of the time, but with the exact same code, at other times it just shows it by default, and checking the box makes it go away.
The web form is in ASP, but all the ASP works fine. "createCheckboxJS" is a function that basically creates a working checkbox that takes on the characteristics of any Javascript put into it (by assigning the last argument to be triggered with "onclick="). Both createCheckboxJS and createCheckbox work perfectly.
This is an example of the code we're using.
- <label><%= createCheckboxJS("whichMediaVStream","true",false,"$('#vidStreamQ').slideToggle()") %>Video Streaming <img src="images/down.png"></label><br>
<div style="padding-left:20px;" id="vidStreamQ">
<label><%= createCheckbox("streamOnDemand","true",false) %>On-Demand Video Streaming (view event from webpage after recording)? </label><br>
<label><%= createCheckbox("streamLive","true",false) %>Live Video Streaming (view while being recorded)?</label><br>
</div>
The form changes depending on what type of event you have. On one of them, this code works fine. On another, the same code doesn't.
What could cause this, and how do I fix it?
Help would be greatly appreciated ^_^