You are here

function asaf_example_gui_simplest in Asaf (ajax submit for any form) 8

Same name and namespace in other branches
  1. 7 modules/asaf_example/asaf_example.gui.simplest.inc \asaf_example_gui_simplest()
2 string references to 'asaf_example_gui_simplest'
AsafCommonTests::testAjaxButtons in tests/asaf.test
asaf_example_menu in modules/asaf_example/asaf_example.module
Implements hook_menu().

File

modules/asaf_example/asaf_example.gui.simplest.inc, line 3

Code

function asaf_example_gui_simplest($form, &$form_state) {
  drupal_set_message(t('To ajaxify this form you have to open !link and put current form ID (%formid) in the forms textarea. ', array(
    '!link' => l('asaf admin page', 'admin/config/system/asaf'),
    '%formid' => __FUNCTION__,
  )), 'warning');
  $form['up'] = array(
    '#markup' => l('← Go to the examples list', 'examples/asaf_example'),
  );
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $form;
}