|
|||
|
I'm using the initial helpers to create a set of radio buttons, such as:
<?= $this->formRadio('pg1_3', $this->formObj->pg1_3, null, array(1=>' Yes',2=>' No'),' ')?> creates: <input name="pg1_3" value="" type="hidden"><label style="white-space: nowrap;"><input name="pg1_3" value="1" type="radio"> Yes</label> <label style="white-space: nowrap;"><input name="pg1_3" value="2" type="radio"> No</label> Upon submitting this form, the controller extracts the "hidden" value, which is "". How can I get the value from the radio button that the user selected in the controller, such as $this->_request->getPost('pg1_3'). It extracts a blank string because that is the value of the hidden field which has SAME name as the radio button. Please help. -Scott ![]() |
|
|||
|
Hi sclaerhout.
At the first thought I think it's because in case a radio button is not selected you would still have the post var "pg1_3". If a radio button is not selected then it will not send a variable in the POST. Same applies with checkboxes. If a checkbox is not selected the variable is not created. Adrian |
![]() |
| Thread Tools | |
| Display Modes | |
|
|