views:

28

answers:

3

on my source i use

<a href='pag.php'><input type='button' value='Next'/></a>

in firefox and crome when i click on the button i'm redirected to pag.php but in ie it don't work. how can i do?

+1  A: 

The simple way is:

<input type='button' value='Next' onclick="location.href='pag.php'"/>
antyrat
A: 

Form buttons are meant to be used for submitting a form to the page specified in the action attribute, not to be wrapped in <a> tags, which is bad syntax. If this is for a multi-part form, simply add the action attribute to the <form> tag like

<form method="POST" action="pag.php">
    <!-- your form elements -->
    <input type="submit" value="Next">
</form>

And that will submit the form to pag.php. Otherwise, just use a link, or, if you insist on having it look like a button, use an image link like:

<a href="pag.php"><img src="image_that_looks_like_a_button.png"></a>

Hope this helps.

FreekOne
"button" type of input doesn't submit the form.
antyrat
"submit" does :) Had "button" in my mind and it slipped through. Corrected, thanks!
FreekOne
An untyped button element does submit the form in webkit and mozilla (the default button type is "submit") -- in IE, the default type is "button".
Stan Rogers
A: 

Instead of what you are doing right now, go for:

<form action="pag.php" method="post" enctype="multipart/form-data">

<INPUT TYPE="submit" name="Submit" value="Next">

</form>

But if you want image instead in place of button, go for:

<INPUT TYPE="image" SRC="image location" ALT="Next">

Hope it solves your problem! :)

Anjali