开发者

Enforce "sudoku-like" (latin square) constraint on radio buttons

开发者 https://www.devze.com 2023-01-28 08:21 出处:网络
In my GUI, I need a 3x3 array of radio-buttons, constrained so that only one can be selected in each row, and only one can be selected in each column.

In my GUI, I need a 3x3 array of radio-buttons, constrained so that only one can be selected in each row, and only one can be selected in each column.

Is this possible client-side, without Javascript (I'm happy to use javascript, but would like a fallback for when JavaScript is off)? O开发者_如何学Gor is my only option Javascript and server-side enforcement?


Realistically, your only option is JavaScript. Enforcing a by-row or by-column constraint on your inputs is obviously quite possible, but it wouldn't be possible to do this in the "sudoku-like" way you're thinking since each set of controls in a group must share the same name.

0

精彩评论

暂无评论...
验证码 换一张
取 消