Hi there,
So I have a dropdown element and javascript on it which shows or hides another element when a user clicks on it . It works fine, but not on tablets and smartphones. I know that there are some differences in the events on desktops and on laptops, but I don't know how to add event listener and which event to watch for. I tried this code on a "on load" event of a element javascript, but it does not work.
The click event only works when the user taps on the dropdown field, but if the user taps on an option (selecting it) the on click event is not fired.
Does anybody gaot an idea of sorting this out.
So I have a dropdown element and javascript on it which shows or hides another element when a user clicks on it . It works fine, but not on tablets and smartphones. I know that there are some differences in the events on desktops and on laptops, but I don't know how to add event listener and which event to watch for. I tried this code on a "on load" event of a element javascript, but it does not work.
PHP:
var field = Fabrik.getBlock('form_2').formElements.get('queries___labor_subservice');
field.addEvent('touchstart', function () {
alert('you touched this element');
});
The click event only works when the user taps on the dropdown field, but if the user taps on an option (selecting it) the on click event is not fired.
Does anybody gaot an idea of sorting this out.
Last edited: