function hide_submit_form_alter in Hide submit button 7.2
Same name and namespace in other branches
- 5 hide_submit.module \hide_submit_form_alter()
- 6 hide_submit.module \hide_submit_form_alter()
- 7 hide_submit.module \hide_submit_form_alter()
Implements hook_form_alter().
File
- ./
hide_submit.module, line 103 - This module blocks users from accidentally submitting a form twice. The protection only comes from jQuery and is not server side, so this is only effective against accidentally clicking of the button by users with Javascript enabled (which is a very…
Code
function hide_submit_form_alter(&$form, &$form_state, $form_id) {
if (user_access('bypass hide submit') && 1 != $GLOBALS['user']->uid) {
return;
}
if (hide_submit_add_settings()) {
hide_submit_attach_js_css($form);
$form['#after_build'][] = 'hide_submit_after_build';
}
}