Forum Moderators: open

Message Too Old, No Replies

Overlapping Radio Button Groups

         

elliotb

7:36 pm on Apr 8, 2005 (gmt 0)

10+ Year Member



I'm in the process of developing a website, and the need has arisen for a form where there could be overlapping groups of radio buttons.

Imagine a row-column style layout like this:


-------A B C
Row 1: o o o
Row 2: o o o
Row 3: o o o

I would like it so that only 1 radio button can be selected in each row/column.
E.g.
A1, B2, C3 would be a valid selection
A1, B1, C2 would not be a valid selection (as 2 values were selected in row 1)
A1, A2, C3 would not be a valid selection (as 2 values were selected in column A).

Obviously, it is easy to achieve the desired behaviour in a single column or row, but not in both at the same time.

Does anybody know of any workarounds? Perhaps it is possible with the use of javascript?

Regards

Elliot

tedster

9:22 pm on Apr 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Elliot, and welcome to the forum - yes, this will take javascript. The name of what you are asking about is a "radio button matrix".

I found a working example page - you should be able to view the source code easily enough, and if the script gives you trouble, I'm sure the folks in our Javascript Forum will be able to help you out if you post over there.

Radio Button Matrix [virtualgeoff.com]

elliotb

2:59 pm on Apr 9, 2005 (gmt 0)

10+ Year Member



Hi,

Thanks for that, it certainly helped, and once I found out what it was called I was able to find more resources about it.