Closed (works as designed)
Project:
Drupal core
Version:
x.y.z
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Oct 2006 at 15:02 UTC
Updated:
9 Oct 2006 at 04:54 UTC
I'm using the button type for a form, even explicitly setting #submit to FALSE, but it still submits. I'm curious, too, why this uses the submit type instead of button... but really, the bug is the issue. Ex:
$form['pane']['continue'] = array(
'#type' => 'button',
'#value' => 'Continue'
);
Straight from the Forms API, submits the form.
$form['pane']['continue'] = array(
'#type' => 'button',
'#submit' => 'FALSE',
'#value' => 'Continue'
);
Still submits. Using a touch of JS is the only way I've been able to get it to not submit:
$form['pane']['continue'] = array(
'#type' => 'button',
'#value' => 'Continue',
'#attributes' => array('onclick' => 'return false;')
);
I don't mind doing that, since I'm using some other JS on the button to expand the next fieldset for the user... but it seems like according to the documentation I shouldn't have to do this. Looking at the code just confuses me, so I have no clue on how to patch it.
Comments
Comment #1
chx commented