Results 1 to 3 of 3

Thread: How can I create.....

  1. #1
    Join Date
    Jul 2006

    Selection matrix??


    Looking for a method to create a matrix of radio buttons.
    Easy enough, but here's the trick:
    buttons must be mutually exclusive in both rows and columns.

    Let's say they're in a 5x5 table (hence, the matrix)
    If the user selects the button at row 2, column 1
    all other buttons in row 2 and column 1 must be unchecked

    I can do either a row or a column, but have not been able to do both.

    Most of my work will be with PHP and HTML.

    Any suggestions?

    Thank you,

    Last edited by Enki; 07-06-2006 at 09:25 PM. Reason: Changing the title/subject line

  2. #2
    Join Date
    Nov 2003
    Jerryville, Tejas
    So if item 4,1 is checked then the rest of both row 4 and column 1 must be cleared? Use a square of (cleverly named) checkboxes rather than radio buttons and drive them with Javascript onclick handlers. The onclick handler can either manipulate the inputs directly or it can just submit the form and you can do it on the server in PHP.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  3. #3
    Join Date
    Aug 2006
    for matrixes, its often simpler to use multidimensional arrays. Like say the first radio is num[0][0], the second will be num[0][1] all the way to the last one num[5][5]. so you only need to create two loops, one to uncheck all with the same x-element, and one to uncheck all with the same y-element



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center