[SOLVED] Form action help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Form action help

Post by C_Calav »

hi guys, ive just finished a shopping cart and i need some help putting 2 url's into form buttons.

here are the two links:

Code: Select all

<a href="cart.php?action=remove_item&id=<?php echo $row&#1111;"itemId"]; ?>">Remove</a>

<a href="cart.php?action=empty_cart">-Empty Cart-</a>
now i need to put these into form buttons and i cant get it to work, here is what i have so far: (just for the remove cart so far)

Code: Select all

<form name="cart" method="GET" action=""> 

<input type="submit" value="Reset"  onclick="form.action=cart.php?action=empty_cart" class="button" /> 

<input type="submit" value="Continue" onclick="form.action='details.php'" class="button" /> 

</form>
the continue button works. but the Reset button doesnt. am i doing this the right way?

any help would be much appreciated! thanx
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post by C_Calav »

got it going, had to change get to post. thanx
Post Reply