I planning to add a drop down button with option groups and option values.
This is my code
$form->add('select', 'a', ts('a'), array( '1' => ts('value 1'), '2' => ts('value 2') ) );
Is there any efficient method to do it? Also i want to capture the option value and save it to a variable in order to save it in the database. I have tried
$form->getvalue('a'), but didn't work. Much appreciate if someone could help me to solve this.