2013-05-22 2 views
0

drupal에서 폼을 프로그래밍 방식으로 생성했습니다. div로 양식의 각 요소를 어떻게 감쌀 수 있습니까? 다음은 내 샘플 코드래퍼로 drupal 폼 생성하기

function emailusers_compose_form($context, $account) { 

    $form['to'] = array(
    '#type' => 'value', 
    '#value' => $account, 
    ); 

$form['message']['subject'] = array(
'#type' => 'textfield', 
'#title' => t('Subject'), 
'#size' => 50, 
'#maxlengh' => 255, 
'#description' => t('The subject of the email message.'), 
); 


$form['submit'] = array(
'#type' => 'submit', 
'#value' => t('Send Mail'), 
); 
return $form; 
} 

답변

2

는 여기

function emailusers_compose_form($context, $account) { 
    $form['to'] = array(
    '#type' => 'value', 
    '#value' => $account, 
); 

    $form['message']['subject'] = array(
    '#type' => 'textfield', 
    '#title' => t('Subject'), 
    '#size' => 50, 
    '#maxlengh' => 255, 
    '#description' => t('The subject of the email message.'), 
    '#prefix' => '<div id="elementid">', 
    '#suffix' => '</div>' 
); 

    $form['submit'] = array(
    '#type' => 'submit', 
    '#value' => t('Send Mail'), 
); 
    return $form; 
} 
+0

는'elementid' 큰 따옴표 (")를 사용할 수있는 대답이다. – kekkis

+0

또한 당신이 그들을 후크 테마를 사용하여 텍스트 필드 덮어 쓸 수 있습니다 – Bdwey