I need to put some custom html tags and code inside the form elements am creating using form api . I defined a fieldset and need to come the html under this fieldset , code sample :
$general_wb_vars = array(
'wb_debug'=>array('type'=>'select','values'=>'ERR,OFF','default_value'=>'OFF','label'=>'Debug','description'=>''),
'wb_cache'=>array('type'=>'radio','values'=>'Yes,No','default_value'=>'No','label'=>'Cache','description'=>''),
'wb_ip'=>array('type'=>'textfield','values'=>'','default_value'=>'192.168.1.1','label'=>'IP','description'=>'')
);
$numofrepeat = 4;
if($form_id=='my-form-id'){
$form['fieldsetm'] = array('#type' => 'fieldset',
'#title' => t('Weblogic configurations'),
'#weight' => 10,
);
for($i=1;$i<=$numofrepeat;$i++){
foreach($general_wb_vars as $id => $setts){
$form['fieldsetm']['field_p_'.$id.'['.$i.'][value]'] = array('#type' => $setts['type'],
'#title' => t($setts['label']),
'#default_value' => $setts['default_value'],
'#description' => t($setts['description']),
'#attributes' => array('id'=>$id.$i),
);
if($setts['type']=='select'){
$form['fieldsetm']['field_p_'.$id.'['.$i.'][value]']['#options'] = explode(',',$setts['values']); }
if($setts['type']=='radio')
$form['filedsetm']['field_p_'.$id.'['.$i.'][value]']['#values'] = explode(',',$setts['values']);
$form['fieldsetm']['some_markup'] = array(
'#type' => 'item',
'#markup' => '---------------------------------------------------------------------',
);
}
}