Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI Question

Status
Not open for further replies.

bitbrain

Programmer
Jun 10, 1999
159
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top