Ejemplo n.º 1
0
$firstname = $form->add(new JamElement('input'));
$firstname->setId('firstname');
// a Radio Buttons
$label = $form->add(new JamElement('label', 'Gender:'));
$radio = $form->add(new JamHorzRadioButtons('gender'));
$radio->add('Male');
$radio->add('Female');
$allLabels[] = $label;
// checkboxes
$label = $form->add(new JamElement('label', 'Do you like Jamboree ?'));
$checkbox = $form->add(new JamElement('input'));
$checkbox->setHtmlOption('type', 'checkbox');
$checkbox->setHtmlOption('checked', 'checked');
$allLabels[] = $label;
$bottomPanel = new JamHorzPanel();
$bottomPanel->setBgColor('#def');
$submit = $bottomPanel->add(new JamElement('input'));
$submit->setHtmlOption('type', 'submit');
$submit->setHtmlOption('value', 'Send');
$form->add($bottomPanel);
foreach ($allLabels as $label) {
    $label->setColor('darkred');
    $label->addHtmlOption('style', 'font-weight: bold;');
}
$form->setId('myform');
$form->setHtmlOption('method', 'post');
$form->setHtmlOption('action', CHtml::normalizeUrl(array('/site/test')));
$form->setWidth('200px');
$form->render();
?>