Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1269
  • 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
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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