/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
RENDER ONLY 1 FIELD <?php print drupal_render($form['group_company']['field_street']['0']['value']); ?> RENDER A GROUP OF FIELDS You don't need to render fields in group one by one, just enter this code to render all fields in a group: <?php print drupal_render($form['group_company']); ?> RENDER A SELECT LIST Almost same like render a TEXTFIELD, but avoid ['0']['value'] at the end <?php print drupal_render($form['group_company']['field_region']); ?> REMOVE AN INPUT FIELD You may want to disable an input form, usually you need to remove TITLE as shown below: HIDE AN INPUT FIELD (HIDE vs REMOVE!) You may still want to enable an input form but need to prevent it: <?php $form['title']['#access'] = FALSE; ?> SHOW ALL VARIABLES OF FORM You may want to know what variables available for you: REORDER Use ['#weight'] to reorder $form['buttons']['#weight'] = -50; // buttons at the top PRINT BUTTONS <?php print drupal_render($form['buttons']); ?> RENAMING BUTTON What is "Submit"? You may need to write it as "Save now!", don't you? $form['buttons']['submit']['#value'] = 'Save to Database'; HIDE GROUP FIELD-SET $form['group_general']['#access'] = FALSE; HIDE BUTTON $form['buttons']['submit']['#access']= FALSE;