hundreds-camera-24900
10/22/2021, 1:34 AMmysterious-toddler-20573
10/22/2021, 2:12 AMhundreds-camera-24900
10/22/2021, 2:17 AMhundreds-camera-24900
10/22/2021, 2:18 AMhundreds-camera-24900
10/22/2021, 2:18 AMmysterious-toddler-20573
10/22/2021, 2:19 AMhundreds-camera-24900
10/22/2021, 2:22 AMhundreds-camera-24900
10/22/2021, 2:22 AMhundreds-camera-24900
10/22/2021, 2:22 AMbitter-dog-98292
10/22/2021, 7:47 AMincalculable-pager-33872
10/22/2021, 11:31 AMincalculable-pager-33872
10/22/2021, 11:31 AMmysterious-toddler-20573
10/22/2021, 1:18 PMincalculable-pager-33872
10/22/2021, 1:24 PMmysterious-toddler-20573
10/22/2021, 2:09 PMbitter-dog-98292
10/22/2021, 2:14 PMmysterious-toddler-20573
10/22/2021, 2:16 PMincalculable-pager-33872
10/22/2021, 2:33 PMcold-lamp-11377
10/22/2021, 2:44 PMhtml
<div id="modal_remove_device" class="modal">
<div class="modal-content">
<form id="remove_device_details">
<h4>{% trans 'Remove device' %}</h4>
<p>
{% blocktrans trimmed %}
Removing a device will cause the device to be wiped, losing all data stored on the device. By default,
after a reset the device will be useable by everyone. If you do not want this, then select "Preserve
factory reset protection data". below Are you sure you want to do this?
{% endblocktrans %}
</p>
<div class="switch">
<label>
<input class="filled-in" type="checkbox" id="preserve_frp">
<span>{% trans 'Preserve factory reset protection data' %}</span>
</label>
</div>
{% if manageddevice.management_mode == manageddevice.ManagementMode.PROFILE_OWNER %}
<div class="input-field">
<input placeholder="Reason why work profile is wiped" id="wipeReason" type="text">
<label for="wipeReason">Wipe reason</label>
</div>
{% endif %}
</form>
</div>
<div class="modal-footer">
<a class="modal-action modal-close waves-effect waves-red btn-flat">Cancel</a>
<a id="btn_remove_device" class="modal-action modal-close waves-effect waves-green btn-flat" hx-get="{% url 'remove_device' manageddevice.id %}" hx-vals="js:htmx.values(htmx.find('#remove_device_details')
)">{% trans 'Remove device' context 'button' %}</a>
</div>
</div>cold-lamp-11377
10/22/2021, 2:47 PMstocky-dentist-80693
10/22/2021, 2:49 PMcold-lamp-11377
10/22/2021, 2:49 PMcold-lamp-11377
10/22/2021, 2:50 PMstocky-dentist-80693
10/22/2021, 2:50 PM<form method="get"> which will send via GET instead of POSTcold-lamp-11377
10/22/2021, 2:51 PMmysterious-toddler-20573
10/22/2021, 2:57 PMmysterious-toddler-20573
10/22/2021, 3:05 PMstocky-dentist-80693
10/22/2021, 3:16 PMhx-vals needs to start with some JSON like the example? e.g. hx-vals="js:{data: htmx.values(htmx.find('#remove_device_details'))}"
Either way, I think having hx-get on the form is better overall so it captures the input values directly, and then change the tag to be a proper button that submits it: <button form="remove_device_details" type="submit" class="...">...</button>brash-microphone-56568
10/22/2021, 3:44 PMstocky-dentist-80693
10/22/2021, 3:50 PMhtmx.process(element); on any new content added outside of htmx