Skip to main content
Known Participant
June 22, 2010
Answered

Two Submits - One Form - OK FF not IE

  • June 22, 2010
  • 3 replies
  • 709 views

I thought this would be simple

I am submitting a form and on it are these two buttons and this works fine in Firefox:

<input type="submit" name="stay" value="Submit" />

<a href="live_summary.php"><input type="button" value="Back"  /></a>

However this does not work in IE and pressing the Back button simply refreshes the page as though submitted.

any ideas.
Simon

This topic has been closed for replies.
Correct answer

When you wrap a link around a button, IE and FF behaves differently. FF prioritize the link (<a href... tag), But IE prioritize the button, which does nothing unless you put some javasctipt on it.

You can tie the button to Javascript, so both FF and IE will be happy:

<input type="button" value="Back" onclick="location.href='live_summary.php'"  />

3 replies

Correct answer
June 23, 2010

When you wrap a link around a button, IE and FF behaves differently. FF prioritize the link (<a href... tag), But IE prioritize the button, which does nothing unless you put some javasctipt on it.

You can tie the button to Javascript, so both FF and IE will be happy:

<input type="button" value="Back" onclick="location.href='live_summary.php'"  />
Participating Frequently
June 22, 2010

What do you want the button to do? You haven't included any js which is required if you want the browser to move back a page.

w424637Author
Known Participant
June 22, 2010

Well simply I have a Form -

One drop down list and Two Buttons.

One Button is Submit - so user makes a change to the dropo down and submits form etc.

Two Button is Back - They hit this and go back to the previous report.

The below works in FF with no Javascript? why not IE

S

w424637Author
Known Participant
June 22, 2010

In fact in IE it does nothing