i have a form that im ajax submitting using the jquery Form plugin.

the form has two submit buttons

$form['save_issue'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
$form['close_issue'] = array(
'#type' => 'submit',
'#value' => t('Close'),
);

The problem is when the form is submitted, it always shows the 'Save' button as being clicked, even when i click on the 'Close' button.

Anyone know the answer?

Comments

nedjo’s picture

Probably you want to avoid explicitly submitting the form when a button is clicked and instead use the ajaxForm() method.

See the ajaxsubmit module's js for sample code http://drupal.org/project/ajaxsubmit

(Or you could consider a dependency on that module.)

corey.aufang’s picture

I will take a look at this module, and if it works, most likely depend it.

Thank you.