oh , thats the catch.. thanks steven<br clear="all">--<br>Regards,<br>Nitin Kumar Gupta<br><a href="http://publicmind.in/blog/">http://publicmind.in/blog/</a><br>
<br><br><div class="gmail_quote">On Wed, Oct 7, 2009 at 2:36 AM, Steven Jones <span dir="ltr">&lt;<a href="mailto:steven.jones@computerminds.co.uk">steven.jones@computerminds.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi,<br>
<br>
When the browser posts the form back to the web server it only sends<br>
the value of the form elements against their respective names. That<br>
is, the following input<br>
<br>
&lt;input type=&quot;sometype&quot; value=&quot;value&quot; id=&quot;some-id&quot; name=&quot;some-name&quot; /&gt;<br>
<br>
would be posted back to the server as<br>
some-name = value.<br>
<br>
Since buttons are also posted back in the same way there is not way<br>
for Drupal know which button was pressed if they share the same name<br>
and value.<br>
<br>
Regards<br>
Steven Jones<br>
ComputerMinds ltd - Perfect Drupal Websites<br>
<br>
Phone : 024 7666 7277<br>
Mobile : 07702 131 576<br>
Twitter : darthsteven<br>
<a href="http://www.computerminds.co.uk" target="_blank">http://www.computerminds.co.uk</a><br>
<br>
<br>
<br>
2009/10/6 nitin gupta &lt;<a href="mailto:nitingupta.iitg@gmail.com">nitingupta.iitg@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; Hello,<br>
&gt; I am having two form submit buttons on a single page, somethings like this:<br>
&gt; $form[&#39;submit1&#39;] = array(<br>
&gt;     &#39;#type&#39; =&gt; &#39;submit&#39;,<br>
&gt;     &#39;#value&#39; =&gt; t(&#39;save&#39;),<br>
&gt;     &#39;#submit&#39; =&gt; array(&#39;test_submit1&#39;),<br>
&gt;<br>
&gt;   );<br>
&gt;<br>
&gt; [some more for elements in between]<br>
&gt;   $form[&#39;submit2&#39;] = array(<br>
&gt;     &#39;#type&#39; =&gt; &#39;submit&#39;,<br>
&gt;     &#39;#value&#39; =&gt; t(&#39;Save&#39;),<br>
&gt;     &#39;#submit&#39; =&gt; array(&#39;test_submit2&#39;),<br>
&gt;<br>
&gt;   );<br>
&gt;<br>
&gt; Now, whether I click on any of them, the submit callback of second button is<br>
&gt; called always. But if I change the value of second button or give them<br>
&gt; different &#39;#name&#39;, everything gets back in place. They call their submit<br>
&gt; functions respectively.<br>
&gt; I did not expect such a behavior given this:<br>
&gt; <a href="http://drupal.org/node/144132#buttons" target="_blank">http://drupal.org/node/144132#buttons</a><br>
&gt; Although, they both have same #value but will have different ids in the<br>
&gt; form, so Drupal has every reason to differentiate between them (or not??).<br>
&gt; Why is such thing happening? Am I missing something?<br>
&gt; --<br>
&gt; Regards,<br>
&gt; Nitin Kumar Gupta<br>
&gt; <a href="http://publicmind.in/blog/" target="_blank">http://publicmind.in/blog/</a><br>
&gt;<br>
</div></div></blockquote></div><br>