I have just started learning Quick Form . I want to know how can I create a check box using the add element and then align it at some desired place . This is what i tried :
$form->addElement('checkbox','testCB1', 'Test my check box',array('checked'=>'checked',value =>'10'));
But my checkbox is not checked neither it gets a value of 10 .
Thanks in advance :)
Call the setChecked()
method:
$form->addElement('checkbox','testCB1', 'Test my checkbox',array('value' =>'10'))->setChecked(true);