Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Two Submits - One Form - OK FF not IE

New Here ,
Jun 22, 2010 Jun 22, 2010

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

TOPICS
Server side applications
725
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Jun 22, 2010 Jun 22, 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'"  />
Translate
New Here ,
Jun 22, 2010 Jun 22, 2010

In fact in IE it does nothing


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2010 Jun 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 22, 2010 Jun 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 22, 2010 Jun 22, 2010
LATEST

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'"  />
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines