drupal 6でカスタム登録フォームを作成しました。テーマにこのコードを追加することで、drupal登録ページの動作を変更しました。テンプレートファイル
function earthen_theme($existing, $type, $theme, $path) {
return array(
// tell Drupal what template to use for the user register form
'user_register' => array(
'arguments' => array('form' => NULL),
'template' => 'user_register', // this is the name of the template
),
);
}
そして私のuser_register.tpl.phpファイルはこのように見えます...
//php tag starts from here
$forms['access'] = array(
'#type' => 'fieldset',
'#title' => t('Access log settings'),
);
$form['my_text_field']=array( '#type' => 'textfield',
'#default_value' => $node->title,
'#size' => 30,
'#maxlength' => 50,
'#required' => TRUE
);
<div id="registration_form"><br>
<div class="field">
<?php
print drupal_render($form['my_text_field']); // prints the username field
?>
</div>
<div class="field">
<?php
print drupal_render($form['account']['name']); // prints the username field
?>
</div>
<div class="field">
<?php
print drupal_render($form['account']['pass']); // print the password field
?>
</div>
<div class="field">
<?php
print drupal_render($form['account']['email']); // print the password field
?>
</div>
<div class="field">
<?php
print drupal_render($form['submit']); // print the submit button
?>
</div>
</div>
カスタマイズされた「my_text_field」の検証方法。
そして、ユーザーがmy_text_fieldをクリックするとすぐに、日時ピッカーが開き、ユーザーが選択した日付に関係なく、その日付がmy_text_fieldの値になるようにします。
だからみんな助けて。
よろしくお願いします、
nitish
Panchjanya Corporation