Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

input button not working in IE8

Posted on 2014-02-03
10
Medium Priority
?
1,235 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

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.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

972 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