5 ms·
They do have logic for reconciling the responses so you can't check "some" and "none", yes. But the article states: > Finally, we also added some JavaScript co
by memco 5y ago
They do have logic for reconciling the responses so you can't check "some" and "none", yes. But the article states:
> Finally, we also added some JavaScript code to prevent users from ticking the ‘none’ checkbox as well as one of the others. This is to avoid users giving contradictory answers.
I hope they have server side checks as well because this enhancement comes at a cost of state management that isn't guaranteed to happen if JS is the only barrier to reconciling incompatible selections.
- xmprt 5y agoWhy would the server side code have to change for this? A none checkbox could just be translated to an empty array and passed down to the server as if none of the options were checked.
- wildrhythms 5y agoA particularly annoying problem with front-end validation is that it's not difficult to circumvent the Javascript logic, check both 'None' and 'All', and send it to the server. It becomes the server's responsibility to make a decision about whether 'None' or 'All' takes precedent.
- nicoburns 5y agoIn this case the server likely doesn’t have a ‘none’ option. The none option in the client will be translated into an empty array (or false for all the other options). So circumventing the client isn’t likely to get you very far.
- alpaca128 5y agoBut 'None' is an invalid, nonexistent option on the server. It's like circumventing validation to send the option 'Foobar'. Or in other words, if the server still accepts this the problem already existed long before.
- noway421 5y agoFrom what I understand, this is a client side feature. Ticking 'none' after this feature is rolled out is the same as leaving nothing ticked before.
- M2Ys4U 5y ago>I hope they have server side checks as well because this enhancement comes at a cost of state management that isn't guaranteed to happen if JS is the only barrier to reconciling incompatible selections. GOV.UK are pretty good when it comes to this stuff and focusing on progressive enhancement.[0] [0] https://www.gov.uk/service-manual/technology/using-progressive-enhancement https://www.gov.uk/service-manual/technology/using-progressi...