Hello to the Community,
I want a change in an HTML select
tag to trigger a Javascript event in my Spree application.
The view contains a collection_select instruction resulting in the following HTML:
<select id="dummy_id" name="something">
<option value="">Please select</option>
<option value="1">Case1</option>
<option value="2">Case3</option>
<option value="3">Case3</option>
</select>
I wrote the following Javascript function:
$('#dummy_id').change(function () {
alert("It works");
});
I checked in this jsfiddle that the code indeed works.
When I run the application, the event is not triggered. I googled a lot to try and find documentation regarding a possible registration.
Question: does the event need some sort of a registration? If yes, where to place it and what should this code look like ? If not, any clue as to why it works fine in jsfiddle but not in RAILS_ENV="development" ?
Kind regards !