function search_autocomplete_form_add in Search Autocomplete 7.3
Same name and namespace in other branches
- 6.4 search_autocomplete.form.add.inc \search_autocomplete_form_add()
- 6.2 search_autocomplete.form.add.inc \search_autocomplete_form_add()
- 7.4 search_autocomplete.form.add.inc \search_autocomplete_form_add()
- 7.2 search_autocomplete.form.add.inc \search_autocomplete_form_add()
MENU CALLBACK: Define the page to add a form.
Return value
A rendered form
1 string reference to 'search_autocomplete_form_add'
- search_autocomplete_menu in ./
search_autocomplete.admin.inc - Implements hook_menu(). Create an administration page to access admin form
File
- ./
search_autocomplete.form.add.inc, line 20 - Search Autocomplete Add a new form to Search Autocomplete form list.
Code
function search_autocomplete_form_add() {
$form = array();
/* ------------------------------------------------------------------ */
$form['title'] = array(
'#title' => t('Title'),
'#description' => 'Please enter a title for this form',
'#type' => 'textfield',
'#default_value' => '',
'#maxlength' => 255,
'#required' => TRUE,
);
$descr = t('Enter a valid query selector for the form. This should be an id or a class surrounding the input box.') . '<br/>' . t('Do not include input. In case of a doubt, refer to the <a href="http://projects.axiomcafe.fr/search-autocomplete">documentation</a>');
$form['selector'] = array(
'#title' => t('Selector'),
'#description' => $descr,
'#type' => 'textfield',
'#default_value' => '',
'#maxlength' => 255,
'#required' => TRUE,
);
// submit buton
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
return $form;
}