Hey all,
I’m sure this is a simple one but I can’t figure out how to change a input from disabled to useable when a checkbox is checked. It’s easy using the Wappler UI to disable an input when a checkbox is checked, but not the other way around.
Any ideas?
ben
February 2, 2021, 12:07am
2
Although the following is code only, the code was produced by following the proper steps in Wappler.
<input id="text1" name="text1" type="text" class="form-control" disabled="true">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="input1" name="input1" dmx-on:changed="text1.disable((checked != input1.checked))">
<label class="form-check-label" for="input1">Default checkbox</label>
</div>
1 Like
Thank you Ben. I’m going to try and reproduce this in the UI - much appreciated!
1 Like
sid
February 2, 2021, 5:24am
4
You can try to bind the disabled attribute.
<input dmx-bind:disabled="!checkbox1.checked">
3 Likes
Perfect, thanks Sid - I didn’t realise I could do it that simply.