mysterious-toddler-20573
11/09/2021, 7:44 PMgorgeous-ghost-95789
11/09/2021, 7:57 PMgorgeous-ghost-95789
11/09/2021, 7:58 PMenough-grass-99356
11/09/2021, 8:35 PMgorgeous-ghost-95789
11/09/2021, 8:37 PMgorgeous-ghost-95789
11/09/2021, 8:38 PMenough-grass-99356
11/09/2021, 8:39 PMthousands-whale-33749
11/10/2021, 3:11 AMgorgeous-ghost-95789
11/10/2021, 4:36 AMgorgeous-ghost-95789
11/10/2021, 4:37 AMuser
11/10/2021, 5:14 AM<select name='account'>
{% for account in accounts %}
<option id="{{ account.id }} value="{{ balance }}">{{ account.name }} | ${{ account.balance}}</option>
{% endfor %}
</select>
And the target DIV its like this:
<div data-kt-dialer-max="***SELECTED OPTION VALUE HERE*****">gorgeous-ghost-95789
11/10/2021, 5:16 AMuser
11/10/2021, 5:17 AMuser
11/10/2021, 5:17 AMuser
11/10/2021, 5:18 AMthousands-whale-33749
11/10/2021, 6:13 AMenough-grass-99356
11/10/2021, 6:52 AM<label>Choose an ice cream flavor:
<select class="ice-cream" name="ice-cream">
<option value="">Select One …</option>
<option value="chocolate">Chocolate</option>
<option value="sardine">Sardine</option>
<option value="vanilla">Vanilla</option>
</select>
</label>
<div id="output" data-my-attribute=""></div>
We want the value of data-my-attribute inside our #output div to reflect whatever is selected inside our ice-cream select field. We can do that with one line of hyperscript - here is how our <select> tag would look, with the hyperscript:
<select class="ice-cream" name="ice-cream"
_="on change set #output's @data-my-attribute to my value">proud-librarian-99598
11/10/2021, 12:54 PMwooden-wall-85896
11/10/2021, 1:17 PMwooden-wall-85896
11/10/2021, 1:17 PMmysterious-toddler-20573
11/10/2021, 1:27 PMuser
11/10/2021, 3:52 PMmysterious-toddler-20573
11/10/2021, 3:53 PMmysterious-toddler-20573
11/10/2021, 3:53 PMlog me in the change handler and see if it is being logged when you changeuser
11/10/2021, 3:58 PMuser
11/10/2021, 3:58 PMmysterious-toddler-20573
11/10/2021, 3:58 PMuser
11/10/2021, 3:59 PMmysterious-toddler-20573
11/10/2021, 3:59 PMuser
11/10/2021, 4:00 PM