Code: Select all
function form_register_form($form, &$form_state) {
$form['user'] = array(
'#type' => 'textfield', //you can find a list of available types in the form api
'#size' => 42,
'#maxlength' => 10,
'#attributes' => array(
'placeholder' => array(t('ユーザー名')),// thêm thuộc placeholder html5
'required' => array(t('required')), // thêm thuộc required html5
),
'#theme_wrappers' => array(),
);
$form['mail'] = array(
'#type' => 'textfield', //you can find a list of available types in the form api
'#size' => 42,
'#maxlength' => 50,
'#attributes' => array(
'placeholder' => array(t('メールアドレス')), // thêm thuộc placeholder html5
'required' => array(t('required')), // thêm thuộc required html5
),
'#required' => TRUE, //make this field required
'#theme_wrappers' => array(),
);
$form['pass'] = array(
'#type' => 'password', //you can find a list of available types in the form api
'#size' => 42,
'#maxlength' => 20,
'#attributes' => array(
'placeholder' => array(t('パスワード作成')), // thêm thuộc placeholder html5
'required' => array(t('required')), // thêm thuộc required html5
),
'#required' => TRUE, //make this field required
'#theme_wrappers' => array(),
);
$form['year'] = array(
'#type' => 'textfield', //you can find a list of available types in the form api
'#size' => 4,
'#maxlength' => 4,
'#attributes' => array(
'class' => array(t('w100 first')),
'required' => array(t('required')), // thêm thuộc required html5
),
'#theme_wrappers' => array(),
);
$form['month'] = array(
'#type' => 'textfield', //you can find a list of available types in the form api
'#size' => 2,
'#maxlength' => 2,
'#attributes' => array(
'class' => array(t('w50')),
'required' => array(t('required')), // thêm thuộc required html5
),
'#theme_wrappers' => array(),
);
$form['day'] = array(
'#type' => 'textfield', //you can find a list of available types in the form api
'#maxlength' => 2,
'#attributes' => array(
'class' => array('w50'), // thay đổi class dùng cho textfield
'required' => array(t('required')), // thêm thuộc required html5
),
'#theme_wrappers' => array(),
);
$form['gender'] = array(
'#type' => 'radios',
'#options' => array( 1=>t('女性'),0=>t('男性'),),
'#default_value' => isset($node->active) ? $node->active : 1,
'#required' => TRUE, //make this field required
'#theme_wrappers' => array(),
);
require_once DRUPAL_ROOT . '/includes/locale.inc';
$options = country_get_list();
$options = country_options();
$form['country'] = array(
'#type' => 'select', //you can find a list of available types in the form api
'#default_value' => array('JP'), //make this field required
'#maxlength' => 2,
'#attributes' => array(
'class' => array('w100'), // thay đổi class dùng cho select
),
'#options' => $options,
'#theme_wrappers' => array(),
);
$prefecturals = prefectural_options();
$form['prefectural'] = array(
'#type' => 'select', //you can find a list of available types in the form api
'#default_value' => isset($_GET['name']) ? $_GET['name'] : '0',
'#attributes' => array(
'class' => array('w140'), // thay đổi class dùng cho select
),
'#options' => $prefecturals,
'#theme_wrappers' => array(),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('この内容で会員登録'), //'この内容で会員登録',
'#default_value' => isset($_GET['name']) ? $_GET['name'] : '0',
'#attributes' => array(
'class' => array( 'login03 w140' ), // Thay đổi class dùng cho button
),
);
//$form['#validate'][] = 'form_register_form_validate';
return $form;
}