I'm in the middle of programming a joomla component, this component will have a multiple step form for registration, the first one containing 2 radio buttons. What is the easiest approach to pass the variable from the radiobutton on to step2? when the user submits the first form the controller is called to display the second step, is there an easier approach to this? Thanks in advance.
Code:
step1 of the form (view code):
<form name="step1" action="<?php echo JRoute::_('index.php option=com_mycomponent&task=mycomponent.register'); ?>" method="POST">
<input type="radio" name="placement" value="0" checked /> Option 1<br />
<input type="radio" name="placement" value="1" /> Option 2<br />
<div class="next" onClick="document.forms['step1'].submit();"></div>
</form>
Controller code to handle mycomponent.register
class mycomponentControllermycomponent extends JController
{
public function register()
{
$this->setRedirect(JRoute::_('index.php?option=com_mycomponent&view=default&layout=step2', false));
}
}
I would like to pass the value from the radio to step2 ;)
Hope i didn't miss a topic concerning this already, couldn't find one atleast!