This should be simple...<br>
<br>
On a form with multiple input buttons, how does the CGI know which button was clicked? I'm using the POST method.<br>
<br>
Thanks in advance!
POST or GET does not matter unless you are over filling the GET capacity.<br>
Provided you are not overflowing get (more than 256 I think),..... <br>
<br>
Use different values for the 'name' elements in the input tags. <br>
One button has name="blue"......<br>
Second button has name="red".......<br>
<br>
With the often used 'sub cgidecode' from the camel books and<br>
%FORM=&cgidecode;<br>
<br>
When a button is clicked (submitted),<br>
the corresponding FORM variable is populated.<br>
If button one (named 'one' with value of 'blue') is clicked, then <br>
$var = $FORM{one}; # will set $var to blue. <br>
<br>
$FORM{two} will be null.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.