You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've nearly finished developing some basic ticket booking elements for torro-forms. But i can't figure out how to correctly include my JS code so it is executed AFTER the form elements have been loaded. Currently i'm helping myself by just using setTimeout() 😞
Current Behavior
So my JS code is included in the extension.php as shown by example code.:
The admin-ticketselection-element.js looks as follows:
(function(torro,$){'use strict';$(document).ready(function(){setTimeout(function(){$(".plugin-lib-ticketchoices-control").each(function(index){letself=$(this);$(this).find("option").each(function(option_index){if($(this).attr('value')==self.data("value")){$(this).attr('selected','');}});});},2000);//yepp, hacked! But only god knows how to get this code executed at the right time!});}(window.torro,window.jQuery));// <-- HOW DO I USE THOSE CORRECTLY?!
Possible Solution
Please document what to do to get the code running at the right time after the page has loaded.
Screenshots / Video
This is, how it looks at the moment. The values for the dropdown fields should be set by JS above:
Thank you for any helpful hint! 😊
The text was updated successfully, but these errors were encountered:
Hi!
Issue Overview
I've nearly finished developing some basic ticket booking elements for torro-forms. But i can't figure out how to correctly include my JS code so it is executed AFTER the form elements have been loaded. Currently i'm helping myself by just using
setTimeout()
😞Current Behavior
So my JS code is included in the
extension.php
as shown by example code.:The
admin-ticketselection-element.js
looks as follows:Possible Solution
Please document what to do to get the code running at the right time after the page has loaded.
Screenshots / Video
This is, how it looks at the moment. The values for the dropdown fields should be set by JS above:
Thank you for any helpful hint! 😊
The text was updated successfully, but these errors were encountered: