Solved

input button not working in IE8

Posted on 2014-02-03
10
1,134 Views
Last Modified: 2014-02-09
<form name="f" action="f.php" class="g" method="post" >

<input name="x" type="button" id="x" class="x" value="x" onClick="this.form.action='x.php';" >

</form>

The button on this form doesn't work in IE
It works perfectly in Chrome & Safari

Can you give me the correct code

thanks
0
Comment
Question by:joomla
  • 8
  • 2
10 Comments
 
LVL 58

Expert Comment

by:Gary
Comment Utility
IE8 is a defunct browser, why are you programming for it?
The only people using it are those on XP and come April they will be likely in a whole heap of trouble.
0
 

Author Comment

by:joomla
Comment Utility
our company uses it.....
0
 

Author Comment

by:joomla
Comment Utility
Cathal
are you suggesting this button works in IE7, IE9, IE10 and IE11
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
It works in 9, 10 and 11 - that you ask about IE7 is very worrying.
I would suggest using jQuery to get around version incompatibility.
0
 

Author Comment

by:joomla
Comment Utility
Cathal
i don't see why you think it's very worrying, it's a simply question
do you have an answer to my IE8 question or not..... other than it's defunct....
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:joomla
Comment Utility
Can anyone help with this ?
I can confirm that the button works in IE10

I can't make it work in IE8 emulating IE9 or IE10
Nor can I make it work with IE8 in compatibility mode
0
 

Author Comment

by:joomla
Comment Utility
I've tried the following
As button type='button' ----------------------------------------------------
1.      document.getElementById('x').action = "x.php";
      document.getElementById('x').submit();

2.      document.x.action = "x.php";
      document.x.submit();

As button type=submit ---------------------------------------------
3.     document.forms['x'].action='x.php'

4.     this.form.action='x.php'

5.     this.forms['x'].action='x.php'

thanks
0
 

Author Comment

by:joomla
Comment Utility
Can anyone help with this
0
 

Accepted Solution

by:
joomla earned 0 total points
Comment Utility
My solution

<script>
function doThisForIE(actionRoutine){
    document.x.setAttribute('action',actionRoutine);
    document.x.submit();
    document.x.setAttribute('action','original_submit_routine');            
}
</script>

<form name='x' action='original_submit_routine'>
<input name="x" type="button" id="x"  onClick="doThisForIE('index.php?p=x')">
<input name="action2" type="submit" value="submit">
</form>
0
 

Author Closing Comment

by:joomla
Comment Utility
works
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now