<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>If you look at the HTML source, the submit button's name is "op" - in the comment form, this lets you switch whether to preview or post, for example. &nbsp;The comment module is probably a good place to look at code, too.</div><div><br></div><div>- Ken Winters</div><br><div><div>On Oct 6, 2009, at 3:57 PM, nitin gupta wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hello,<div><br></div><div>I am having two form submit buttons on a single page, somethings like this:</div><div><br></div><div><div>$form['submit1'] = array(</div><div>&nbsp;&nbsp; &nbsp;'#type' =&gt; 'submit',</div> <div>&nbsp;&nbsp; &nbsp;'#value' =&gt; t('save'),</div><div>&nbsp;&nbsp; &nbsp;'#submit' =&gt; array('test_submit1'),</div><div>&nbsp;&nbsp; &nbsp;</div><div>&nbsp;&nbsp;);</div><div>&nbsp;&nbsp;</div><div>[some more for elements in between]</div><div><br> </div><div>&nbsp;&nbsp;$form['submit2'] = array(</div><div>&nbsp;&nbsp; &nbsp;'#type' =&gt; 'submit',</div><div>&nbsp;&nbsp; &nbsp;'#value' =&gt; t('Save'),</div><div>&nbsp;&nbsp; &nbsp;'#submit' =&gt; array('test_submit2'),</div> <div>&nbsp;&nbsp; &nbsp;</div><div>&nbsp;&nbsp;);</div></div><div><br></div><div><br></div><div>Now, whether I click on any of them, the submit callback of second button is called always. But if I change the value of second button or give them different '#name', everything gets back in place. They call their submit functions respectively.</div> <div><br></div><div>I did not expect such a behavior given this:</div><div><br></div><div><a href="http://drupal.org/node/144132#buttons">http://drupal.org/node/144132#buttons</a></div><div><br></div><div>Although, they both have same #value but will have different ids in the form, so Drupal has every reason to differentiate between them (or not??). Why is such thing happening? Am I missing something?</div> <div><br></div><div>--<br>Regards,<br>Nitin Kumar Gupta<br><a href="http://publicmind.in/blog/" target="_blank">http://publicmind.in/blog/</a><br> </div></blockquote></div><br></body></html>