tags:

views:

65

answers:

4
<a href="Signup.php">
  <input name="" value="register" type="button" class="button" />
</a>

How to fix it?

+4  A: 

It's improper. If you want that button to go to signup.php, do so the proper way:

<form method="GET" action="signup.php">
  <input type="submit" value="Register">
</form>

Or the javascript method:

<input type="button" value="Register" onclick="window.location='signup.php'" />
Jonathan Sampson
It's already inside a `form`
take it out of the a
sakabako
Also make sure you're using `type="submit"` instead of `type="button"`. It will still look the same.
sakabako
FYI: It's `Signup.php` (uppercase `S`) in the question but `signup.php` (lowercase `s`) in your answer. That might be why this isn't working for the asker.
Asaph
No,it will go to the toppest `form` when nested.
A: 

Try this:

<a href="Signup.php" title="Register">Register</a>
BranTheMan
I need to keep the button
Then Jonathan's answer is what you want.
BranTheMan
No,it's not working
+1  A: 

If you're going to require it

  • To be a button
  • To not use another form

Then you'll have to use JavaScript, though it's not preferred for navigation.

<input name="" value="register" type="button" class="button" onclick="document.location='Signup.php'" />

You're probably still best to close the form that the button is within and create the separate form, but I can't say what you're working with or your requirements.

Zurahn
A: 

Jonathan's answer should be working. The problem might be with the php rather than markup here. If you must keep the anchor tag why don't you just style it to look like your button?

One thing is for sure, an anchor tag wrapping an input tag won't work on IE.

Gui Andrade