简体   繁体   中英

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

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)? Or 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM