I understood his request differently, that he wanted to send the parameters
to different scripts depending on the submit button pushed.

-----Original Message-----
From: Hanson, Robert [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 3:44 PM
To: 'GsuLinuX'; [EMAIL PROTECTED]
Subject: RE: buton names


You can do it just like that.

Given this HTML form:

<form action="/cgi-bin/test.cgi">
<input type="submit" name="button1" value="This is button 1">
<input type="submit" name="button2" value="This is button 2">
</form>

You can use this script:

#!/usr/bin/perl

use CGI qw/:standard/;

print header();

if ( param('button1') ) {
    print "Button 1 was pushed!";
}
elsif ( param('button2') ) {
    print "Button 2 was pushed!";
}

Camilo, why is that a problem?  Is there inconsistencies between how
browsers handle that info?  I don't know of any problems with it offhand,
and I have used it in the past (a long, long, time ago... nothing recent).

Rob

-----Original Message-----
From: GsuLinuX [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 3:22 PM
To: [EMAIL PROTECTED]
Subject: buton names


Hola! , 

There are 2 submit butons under my form and the information entered to the
form will be send to different cgi's. How can i do this?

One idea i thougt is to give names to the buttons and in the cgi :
if buton name is "buton1"
{ code1 }
if buton name is "buton2"
{code2 }

how can i do that if it's possible

thanx
funky
Istanbul


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to