
"By default, the all All Trading Days checkbox is checked. I want that when any weekday / weekdays is / are checked - the all trading days will be unxhecked automatically and it works. I also want that if I change my mind and uncheck the checked weekday and none of weekdays is checked - the all Trading Days checkbox will be automatically checked."
"<div style="display:flex; gap:20px;"> <div> <label><input type="checkbox" name="weekday[]" value="6" class="days"> Sunday</label><br> <label><input type="checkbox" name="weekday[]" value="0" class="days"> Monday</label><br> <label><input type="checkbox" name="weekday[]" value="1" class="days"> Tuesday</label> </div> <div> <label><input type="checkbox" name="weekday[]" value="2" class="days"> Wednesday</label><br> <label><input type="checkbox" name="weekday[]" value="3" class="days"> Thursday</label><br> <label><input type="checkbox" name="weekday[]" value="4" class="days"> Friday</label> </div> </div> <label style="display:block;margin-top:10px;"> <input type="checkbox" name="weekdays" value="7" class="alldays" checked> All Trading Days </label> By default, the all All Trading Days checkbox is checked."
A form contains individual weekday checkboxes and a master "All Trading Days" checkbox. The master checkbox is initially checked. When any individual weekday checkbox is checked, the master should automatically uncheck. When the last selected weekday is unchecked and none remain selected, the master should automatically re-check. The current jQuery unchecks the master on any weekday change but lacks logic to re-check the master when no weekdays are selected and to avoid unwanted re-checks when toggling individual weekdays while others remain checked.
Read at SitePoint Forums | Web Development & Design Community
Unable to calculate read time
Collection
[
|
...
]