I am using Quickform on a page that gathers a user's credit card info and I am running into trouble accessing some user input.
I have radio buttons for the user to select the type of credit card they wish to use, but what it actually stores is an array of some sort rather than the selected value (Master Card or Visa).
Code:
//Add card type radio buttons
$radios[] = &HTML_QuickForm::createElement('radio', 'b_card_type', 'Visa', 'Visa', 'Visa');
$radios[] = &HTML_QuickForm::createElement('radio', 'b_card_type', 'Master Card', 'Master Card', 'Master Card');
$form->addGroup($radios, 'b_card_type', 'Card Type', ' ');
$form->addRule('b_card_type','Enter card type','required',NULL,'client');
$form->setDefaults(array('b_card_type', 'Visa'));
//Then I store it later like this (using a custom session class for this)
$session->set('b_card_type',$_POST['b_card_type']);
I also have two HTML drop down menus for the user to select the expiration date of the card. Those are returning nothing at all.
Code:
//Add the expiration boxes
$exp[] = &HTML_QuickForm::createElement('select', 'b_month', 'Month',$months);
$exp[] = &HTML_QuickForm::createElement('select', 'b_year', 'Year',$years);
$form->addGroup($exp, 'exp ','Expiration Date:', ' / ');
//Stored in a session like this
$session->set('b_month',$_POST['b_month']);
$session->set('b_year',$_POST['b_year']);
It is worth noting that all other text fields in this form store just fine in the session vars.