
"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."
The form contains individual weekday checkboxes arranged in two columns and a separate 'All Trading Days' checkbox that starts checked. Desired behavior is mutual exclusivity: selecting any weekday must uncheck 'All Trading Days', and selecting 'All Trading Days' must clear or deselect all weekday checkboxes. If all individual weekdays become unchecked, 'All Trading Days' should automatically become checked again. The existing jQuery only unchecks 'All Trading Days' on weekday changes and lacks logic to recheck 'All Trading Days' when no weekdays remain or to clear weekdays when 'All' is checked. Implement complementary change handlers and use a checked-count check to enforce correct state transitions.
Read at SitePoint Forums | Web Development & Design Community
Unable to calculate read time
Collection
[
|
...
]