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?

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.