Solved

input button not working in IE8

Posted on 2014-02-03
10
1,161 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
ID: 39831518
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
ID: 39831520
our company uses it.....
0
 

Author Comment

by:joomla
ID: 39831521
Cathal
are you suggesting this button works in IE7, IE9, IE10 and IE11
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 58

Expert Comment

by:Gary
ID: 39831529
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
ID: 39831533
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
 

Author Comment

by:joomla
ID: 39831635
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
ID: 39831641
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
ID: 39832102
Can anyone help with this
0
 

Accepted Solution

by:
joomla earned 0 total points
ID: 39832159
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
ID: 39845097
works
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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)

808 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