I have a simple form
function example_form($form, &$form_state) {
$form['#attributes']['method'] = 'get';
$form['button'] = array(
'#type' => 'submit',
'#value' => 'Submit',
);
$form['search'] = array(
'#type' => 'textfield',
'#required' => FALSE,
);
return $form;
}
and a submit handler
function example_form_submit($form, &$form_state) {
$form_state['rebuild'] = TRUE;
drupal_set_message(t('Form Submitted'));
}
When I click the button, the form submits properly and the URL gets all the form parameters.
but when I reload the page with all those URL parameters, the example_form_submit()
is not firing, how do I make my form submit/fire the submit hook when the URL is reloaded with GET parameters?