Jump to content

Strange 2nd button in form & validation issues


sKunKbad

Recommended Posts

I inherited some code which contains this button:

 

<a href="checkout.php"><button type="button" name="checkout" value="Checkout">Checkout</button></a>

 

which is inside a form, and the form has a regular submit button too, which is used to update the quantities of products in the shopping cart.

 

This second button/hyperlink does not validate, but in order to make the page look good it has to stay where it is. Normally I'd just place it inside its own form tags, but I don't think it will validate to have a form inside a form.

 

Any ideas?

you could remove the button tag all together and style the a tag to llok like the submit button (you'd have to style the submit button a little too and note not all browsers will actually apply the styling on buttons), OR replace it with an input type="button" tag (would have to remove the a tag and use js to change location)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.