I am adding the HTML/Javascript Gadget and adding the code:
HTML
<strong>OPTION 1</strong>
<select class="selectpicker" name="number">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<br />
<strong>OPTION 2</strong>
<select class="selectpicker" name="abc">
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
<option value="4">D</option>
<option value="5">E</option>
</select>
Javascript
$('.selectpicker').selectpicker({
style: 'btn-info',
size: 4
});
$('.selectpicker').on('change', function () {
var opValue = $(this).val();
console.log(opValue);
$('.selectpicker').val(opValue);
$('.selectpicker').selectpicker('refresh');
});
Dropdowns seem to be getting displayed with this but the functionality is not. I am adding both HTML and Javascript code in the same gadget. I also tried adding the Javascript code in the body/head section of the HTML Coding, but :(