I created a module which makes use of Drupal Developer following code.
operate module_template_menu() { $gadgets = array(); $gadgets['them-noi-dung'] = array( 'title' => t('Khai báo hóa chất'), 'web page callback' => 'drupal_get_form', 'web page arguments' => array('module_template_select_form',2), 'entry callback' => true, ); return $gadgets; } operate module_template_select_form($type, &$form_state) { $type = array(); $type['select'] = array( '#kind' => 'radios', '#title' =>'Lựa chọn hình thức khai báo', '#choices' => array( '0' => t('Khai báo lần đầu'), '1' => t('Đã từng khai báo') ), '#default_value' => '0', ); $type['ma_so_thue'] = array( '#kind' => 'textfield', '#measurement' => '20', '#title' => 'Vui lòng nhập vào Mã Số Thuế', '#states' => array( 'seen' => array(':radio[name="select"]' => array('worth'=>'1')), ), ); $type['submit'] = array( '#kind' => 'submit', '#worth' => t('Tiếp tục'), ); return $type; } operate module_template_select_form_submit($type, &$form_state) { $choose = $form_state['values']['select']; $masothue = $form_state['values']['ma_so_thue']; if (isset($choose)) { $masothue = $form_state['values']['ma_so_thue']; $form_state['redirect'] = 'node/add/khai-bao-hoa-chat'; } } operate module_template_form_alter(&$type, &$form_state, $form_id) { $masothue = $form_state['values']['ma_so_thue']; if ($form_id == 'khai_bao_hoa_chat_node_form') { $type['field_ten_to_chuc']['und'][0]['value']['#default_value'] = $masothue; } } operate module_template_theme($present, $kind, $theme, $path) { $gadgets = array(); $gadgets['khai_bao_hoa_chat_node_form'] = array( 'render factor' => 'type', 'template' => 'khai-bao-hoa-chat', 'path' => drupal_get_path('module', 'module_template'), ); return $gadgets; }
Why can’t I get Drupal Developer worth of $form_state['value']['ma_so_thue']
in module_template_form_alter(&$type, &$form_state, $form_id)
when Drupal Developer type is submitted?