How to open a slider on dropdown change?

Open a slider on dropdown selection in ChronoForms.

Overview

The issue occurs because the initial code only runs on page load, not when a dropdown value changes.
Use a JavaScript action attached to the dropdown's change event to remove the collapse class from the target slider.

Answered
da damienbut 23 Apr, 2014
Hi,

I have a form with three sliders containing dropdowns. The first slider is open by default. When I select an option from the dropdown in the first slider I want the second slider to open. This will then display the next set of options.

I have the code
jQuery(document).ready(function($){
 jQuery('#slider-14').removeClass('collapse');
 });


However this only works when placed in the on load event in a JavaScript action.

Is it possible to evoke this code when I select an option in a dropdown in slider one?

Many thanks
da damienbut 01 May, 2014
Answer
OK, since I have had no reply to this issue then I spent some time resolving it myself.

You need to insert the following code into a load javascript action in the on load event on the setup page:


jQuery(document).ready(function(){
   jQuery('#name_of_your_input').on('change', function() {
      jQuery('#id_of_slider').removeClass('collapse');
   });
  });
This topic is locked and no more replies can be posted.