Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,127
    Thanks
    27
    Thanked 0 Times in 0 Posts

    How to return Multiple Values with Radio Button?

    I have a form with Radio Buttons like this...
    PHP Code:
        <input id='Requestor" . $memberID . "_1' name='friendRequestDecision["
        . $memberID . "]' 
    type='radio' value='0' "
        . ((isset($friendRequestDecision[$memberID]) && $friendRequestDecision[$memberID] == '0') ? "
    checked='checked'" : "")
        . $disable . " 
    /> 

    I am trying to figure out how I can return a value for the selected Radio Button PLUS two other values (i.e. $requestorID, $requesteeID)

    Unfortunately, arrays are my weak point.

    I sorta know how to return an array in the name variable of a Form, but I'm not sure if that would work with the code above...

    Sincerely,



    Debbie

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,531
    Thanks
    8
    Thanked 1,091 Times in 1,082 Posts
    Separate them by pipes | and then explode them when processing?

    value="0|$requestorID|$requesteeID"

    $parts=explode("|",$radiobuttonvalue);


  •  

    Posting Permissions

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