Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make href will work on button in IE8

I want href will work on type="button"in IE8.

<a href="submit.php"><input type="button" value="Submit" class="button" /></a>

Other browser working fine but on IE8 the code above not working. How to fix it?

Update

<form action="submit.php" method="post"">
<input type="submit" value="Submit" class="button" />
</form>

I know this way can be done. But I want to know other ways how to make it work on IE8 without to have the <form></form>

like image 682
wow Avatar asked Jun 01 '10 13:06

wow


2 Answers

onclick="window.location=this.parentNode.href;"/>

this.parentNode can refer to a tag so... it should work or test getAttribute even

like image 128
KoolKabin Avatar answered Oct 20 '22 00:10

KoolKabin


why not use

<form action="submit.php" method="get">
<input type="button" value="Submit" class="button" />
</form>

?

like image 32
Wayne Werner Avatar answered Oct 20 '22 00:10

Wayne Werner