<?php
// this is in template.php
function business_search_form() {
$form['pv_keywords'] = array(
'#type' => 'textfield'
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'submit',
);
return $form;
}
function business_search_form_submit($form_id, $form_values) {
return "search/node/" . $form_values['pv_keywords'] . " type:business";
}
?>
<?php
// this is on the front page
print drupal_get_form('business_search_form');
?>
This is the output:
<form action="/test" method="post" id="business-search-form">
<div><input type="hidden" name="form_token" id="edit-business-search-form-form-token" value="b51412de485cdc3e3d9e842cf336293f" />
<input type="hidden" name="form_id" id="edit-business-search-form" value="business_search_form" />
</div></form>
This is the error message in the logs:
call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argumented is expected to be a valid callback, 'business_search_form' was given in /home/****/public_html/****/includes/form.inc on line 217.