|
Posted by Jerry Stuckle on 01/13/08 23:58
ktstone2678@gmail.com wrote:
> On Jan 12, 8:20 pm, ktstone2...@gmail.com wrote:
>> On Jan 12, 1:31 pm, a...@spamcop.net (axlq) wrote:
>>
>>
>>
>>> In article <8285a830-6c14-44bf-ae55-841229348...@t1g2000pra.googlegroups.com>,
>>> <ktstone2...@gmail.com> wrote:
>>>> I have a basic shopping cart setup, currently the user clicks a button
>>>> to remove an item from the cart. The form action posts to itself in
>>>> order to update the item list.
>>>> Is it possible to have another button in the same form that posts to a
>>>> different location?
>>> Why would you want to do that? Why not just have the second submit
>>> button post to the same location? Two submit buttons on the same
>>> form can perform two different functions. I do this all the time.
>>> The buttons have different value parameters, the php script picks up
>>> on which one was clicked, and acts accordingly.
>>> If you want two buttons in the same form to post to different
>>> locations, you need javascript to modify the form URL. Not a good
>>> idea, IMO, to rely on javascript when you don't have to.
>>> -A
>> Ideally that's would I would like to do. I need to do research on how
>> to accomplish that , but I think that's the best solution. Thanks for
>> you advice everyone
>
> I wanted to post the solution for anyone else who might stumble across
> this thread, turns out to be very simple.
>
> <form name="theform" action="oops.htm" method="get">
> <input name="one" value="type something here...">
> <input type="submit" name="submit" value="first"
> onClick="document.theform.action='first.htm';">
> <input type="submit" name="submit" value="second"
> onClick="document.theform.action='second.htm';">
> </form>
>
Yep, and it fails for me and about 10-15& of the rest of the world
because we browse with javascript disabled.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|