Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I have a page where I have <button> tags and I simply wrap them inside <a href> but TIDY says this is not legit. What's the correct way to do the following:

 

<a href="?action=go"><button>GO</button></a>

 

The W3C doesn't mention anything either: http://www.w3schools.com/tags/tag_button.asp

 

Technically, the traditional way to do this, which works fine but is very verbose is:

 

<form style="display: inline;"><input type="hidden" name="action" value="go"><input type="submit"></form>

 

but as you have more GET values to push, this gets very long (I already have 3 in my real code). I'm just looking for a cleaner & more elegant way to achieve this.

Edited by travisowens
Experience is something you don't get until just after the moment you needed it
Posted (edited)

The following syntax is legit but it then the button no longer goes anywhere.

 

<button><a href="?action=go">GO</a></button>

Edited by travisowens
Experience is something you don't get until just after the moment you needed it

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.   Paste as plain text instead

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