Membership: how to inject form data into CMSB database - more advanced than readme.txt offers

By Codee - February 18, 2013

Hi group,

I am using the membership plugin and have been following the readme.txt for creating a set of radio button options for injecting a choice into the accounts section of the database. BUT because in my accounts section I have a field called "team" that corresponds to a section called "Teams" and is an auto filled dropdown. So, obviously when I follow these instructions in building the html form:

"<tr>
   <td valign="top">Team</td>
   <td>
     <?php $fieldname = 'team'; ?>
     <?php $idCounter = 0; ?>
     <?php foreach (getListOptions($GLOBALS['WSM_ACCOUNTS_TABLE'], $fieldname) as $value => $label): ?>
       <?php $id = "$fieldname." . ++$idCounter; ?>
       <input type="radio" name="<?php echo $fieldname ?>" id="<?php echo $id ?>"
             value="<?php echo htmlspecialchars($value) ?>" <?php checkedIf(@$_REQUEST[$fieldname], $value) ?> />
       <label for="<?php echo $id ?>"><?php echo htmlspecialchars($value) ?></label><br/>

     <?php endforeach ?>
   </td>
  </tr>
"
The injected field for "team" into the Accounts table is only the number.  I'm thinking there's probably a couple of ways to work with this, but I don't fully understand how to do any of them, so I am asking for help.

Possibility 1) I tried using a variety of methods for using the :label pseudofield since it's a php coded form, but was unsuccessful. Is there an easy way to make that work?

Possibility 2) Is there a way to set the getListOptions to the TEAMS table instead of the ACCOUNTS table but still inject the field into the accounts table at the @$_REQUEST point? I was unsuccessful with these attempts to. and,

Possibility 3) Is there a better way?

By Codee - February 19, 2013

Thanks, Greg! I'll giv 'er a go.