Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1246
  • Last Modified:

input button not working in IE8

<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
joomla
Asked:
joomla
  • 8
  • 2
1 Solution
 
GaryCommented:
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
 
joomlaAuthor Commented:
our company uses it.....
0
 
joomlaAuthor Commented:
Cathal
are you suggesting this button works in IE7, IE9, IE10 and IE11
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
GaryCommented:
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
 
joomlaAuthor Commented:
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
 
joomlaAuthor Commented:
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
 
joomlaAuthor Commented:
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
 
joomlaAuthor Commented:
Can anyone help with this
0
 
joomlaAuthor Commented:
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
 
joomlaAuthor Commented:
works
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now