Re: two submit buttons possible?
| From: | Alex Black | Date: | Thu, 11 Jan 2001 02:19:33 +0000 |
| Subject: | Re: two submit buttons possible? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33876@lists.php.net to get a copy of this message | ||
just name the submit:
input type="submit" name="credit_card"
and
input type="submit" name="dealer"
that's easy to capture.
-alex
--
Alex Black, Head Monkey
enigma@turingstudio.com
The Turing Studio, Inc.
http://www.turingstudio.com
vox+510.666.0074
fax+510.666.0093
Saul Zaentz Film Center
2600 Tenth St Suite 433
Berkeley, CA 94710-2522
> From: cal@calevans.com ("Cal Evans")
> Newsgroups: php.general
> Date: 5 Jan 2001 09:09:03 -0800
> Subject: RE: [PHP] two submit buttons possible?
>
> I'd use JavaScript and the onSubmit() of the form to redirect the action of
> the form based on the button pressed.
>
> Cal
>
> -----Original Message-----
> From: Geoff Coffey [mailto:gcoffey@wmotion.com]
> Sent: Friday, January 05, 2001 10:45 AM
> To: PHP General
> Subject: Re: [PHP] two submit buttons possible?
>
>
> on 1/5/01 9:37 AM, Tom Beidler at tbeidler@mindspring.com wrote:
>
>> I'm wondering if there is a way in PHP to have two submit buttons on a
> form.
>> One directs to one page, the other to another page.
>>
>> I have a checkout process that has two options, one for credit card users
>> that needs to be secure, the other uses a dealer id which doesn't need to
> be
>> secure.
>>
>> The ISP we are working with can't get SSL and PHP on the same daemon. Most
>> orders do not be secure so I can use PHP to fill in most of the form for
>> them using PHP and MySQL. If they need to be secure I can't use PHP and
>> there by cannot fill out the form ( unless there is some way to pass the
>> variables from a PHP page to a vanilla html page?).
>>
>> Any assistance would be greatly appreciated.
>
> With javascript, you could have the buttons submit one of two hidden forms,
> each of which goes to a different php script (action=...)...but there's
> probably a better way.
>
> Just put two submit buttons on your form with different values (labels) and
> the same name. On the PHP side, you can check which button was clicked
> because it's value will be the value of the variable associated with the
> submit button...does that make sense? Submit buttons are kind of like
> one-shot radio buttons...the one you click sends it's value back with the
> form...
>
> Hope this helps,
>
> Geoff
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>