Support Forums

Full Version: Script error with IE8?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is a script i was working on and could not work out the problem.
Basically its simply a quote form of sorts. But works fine in FF but not in IE8?
Now i have taken away all the html crap and posted only the code as i think this is where the problem lies. Well im sure of it actually.

PHP Code:
<?php           
$Colors 
$_POST[Colors];
$quantity $_POST[quantity];
$size $_POST[size];
?>
Simple enough.

Now for the processing part.

PHP Code:
<?php
 
/* 1 col A6 */
if ($quantity == "100" && $Colors == "1col" && $size == "a6") {echo "$231.00";}
if (
$quantity == "250" && $Colors == "1col" && $size == "a6") {echo "$253.00";}
if (
$quantity == "500" && $Colors == "1col" && $size == "a6") {echo "$550.00";}
if (
$quantity == "1000" && $Colors == "1col" && $size == "a6") {echo "$792.00";}
if (
$quantity == "2500" && $Colors == "1col" && $size == "a6") {echo "$1892.00";}
 
/* 2 col A6 */
if ($quantity == "100") if ($Colors == "2col") if ($size == "a6") {echo "$319.00";}
if (
$quantity == "250") if ($Colors == "2col") if ($size == "a6") {echo "$352.00";}
if (
$quantity == "500") if ($Colors == "2col") if ($size == "a6") {echo "$682.00";}
if (
$quantity == "1000") if ($Colors == "2col") if ($size == "a6") {echo "$913.00";}
if (
$quantity == "2500") if ($Colors == "2col") if ($size == "a6") {echo "$2178.00";}
/* 3 col A6 */                   
if ($quantity == "100") if ($Colors == "3col") if ($size == "a6") {echo "$330.00";}
if (
$quantity == "250") if ($Colors == "3col") if ($size == "a6") {echo "$418.00";}
if (
$quantity == "500") if ($Colors == "3col") if ($size == "a6") {echo "$792.00";}
if (
$quantity == "1000") if ($Colors == "3col") if ($size == "a6") {echo "$1023.00";}
if (
$quantity == "2500") if ($Colors == "3col") if ($size == "a6") {echo "$2277.00";}
/* 4 col A6 */
if ($quantity == "100") if ($Colors == "4col") if ($size == "a6") {echo "$352.00";}
if (
$quantity == "250") if ($Colors == "4col") if ($size == "a6") {echo "$572.00";}
if (
$quantity == "500") if ($Colors == "4col") if ($size == "a6") {echo "$847.00";}
if (
$quantity == "1000") if ($Colors == "4col") if ($size == "a6") {echo "$1089.00";}
if (
$quantity == "2500") if ($Colors == "4col") if ($size == "a6") {echo "$2365.00";}
  
/* 1 col A5 */                                                
if ($quantity == "100") if ($Colors == "1col") if ($size == "a5") {echo "$308.00";}
if (
$quantity == "250") if ($Colors == "1col") if ($size == "a5") {echo "$550.00";}
if (
$quantity == "500") if ($Colors == "1col") if ($size == "a5") {echo "$759.00";}
if (
$quantity == "1000") if ($Colors == "1col") if ($size == "a5") {echo "$1100.00";}
if (
$quantity == "2500") if ($Colors == "1col") if ($size == "a5") {echo "$2629.00";}
 
/* 2 col A5 */        
if ($quantity == "100") if ($Colors == "2col") if ($size == "a5") {echo "$363.00";}
if (
$quantity == "250") if ($Colors == "2col") if ($size == "a5") {echo "$704.00";}
if (
$quantity == "500") if ($Colors == "2col") if ($size == "a5") {echo "$946.00";}
if (
$quantity == "1000") if ($Colors == "2col") if ($size == "a5") {echo "$1375.00";}
if (
$quantity == "2500") if ($Colors == "2col") if ($size == "a5") {echo "$2860.00";}
/* 3 col A5 */                          
if ($quantity == "100") if ($Colors == "3col") if ($size == "a5") {echo "$396.00";}
if (
$quantity == "250") if ($Colors == "3col") if ($size == "a5") {echo "$726.00";}
if (
$quantity == "500") if ($Colors == "3col") if ($size == "a5") {echo "$968.00";}
if (
$quantity == "1000") if ($Colors == "3col") if ($size == "a5") {echo "$1419.00";}
if (
$quantity == "2500") if ($Colors == "3col") if ($size == "a5") {echo "$3245.00";}
/* 4 col A5 */         
if ($quantity == "100") if ($Colors == "4col") if ($size == "a5") {echo "$439.00";}
if (
$quantity == "250") if ($Colors == "4col") if ($size == "a5") {echo "$759.00";}
if (
$quantity == "500") if ($Colors == "4col") if ($size == "a5") {echo "$1023.00";}
if (
$quantity == "1000") if ($Colors == "4col") if ($size == "a5") {echo "$1485.00";}
if (
$quantity == "2500") if ($Colors == "4col") if ($size == "a5") {echo "$3630.00";}
/* 1 col A4 */                                                    
if ($quantity == "100") if ($Colors == "1col") if ($size == "a4") {echo "$429.00";}
if (
$quantity == "250") if ($Colors == "1col") if ($size == "a4") {echo "$737.00";}
if (
$quantity == "500") if ($Colors == "1col") if ($size == "a4") {echo "$1122.00";}
if (
$quantity == "1000") if ($Colors == "1col") if ($size == "a4") {echo "$1936.00";}
if (
$quantity == "2500") if ($Colors == "1col") if ($size == "a4") {echo "$4290.00";}
/* 2 col A4 */        
if ($quantity == "100") if ($Colors == "2col") if ($size == "a4") {echo "$495.00";}
if (
$quantity == "250") if ($Colors == "2col") if ($size == "a4") {echo "$968.00";}
if (
$quantity == "500") if ($Colors == "2col") if ($size == "a4") {echo "$1309.00";}
if (
$quantity == "1000") if ($Colors == "2col") if ($size == "a4") {echo "$2145.00";}
 if (
$quantity == "2500") if ($Colors == "2col") if ($size == "a4") {echo "$4455.00";}
/* 3 col A4 */                         
if ($quantity == "100") if ($Colors == "3col") if ($size == "a4") {echo "$539.00";}
if (
$quantity == "250") if ($Colors == "3col") if ($size == "a4") {echo "$1275.00";}
if (
$quantity == "500") if ($Colors == "3col") if ($size == "a4") {echo "$1353.00";}
if (
$quantity == "1000") if ($Colors == "3col") if ($size == "a4") {echo "$2497.00";}
if (
$quantity == "2500") if ($Colors == "3col") if ($size == "a4") {echo "$4884.00";}
/* 4 col A4 */        
if ($quantity == "100") if ($Colors == "4col") if ($size == "a4") {echo "$561.00";}
if (
$quantity == "250") if ($Colors == "4col") if ($size == "a4") {echo "$1056.00";}
if (
$quantity == "500") if ($Colors == "4col") if ($size == "a4") {echo "$1430.00";}
if (
$quantity == "1000") if ($Colors == "4col") if ($size == "a4") {echo "$2600.00";}
if (
$quantity == "2500") if ($Colors == "4col") if ($size == "a4") {echo "$5280.00";}
?>

Once again no big deal. Just processing a quote and echoing the result.
Now what i tried to do next is once the form had been processed it produced not only the above result but also a couple of buttons to further navigate. This is where the issue is.

PHP Code:
if ($size == "a4") echo "<a href='processor1.php'><input type='button' action='/' name='Process Order' id='Process' value='Back'></a>";
if (
$size == "a5") echo "<a href='processor1.php'><input type='button' action='/' name='Process Order' id='Process' value='Back'></a>";
if (
$size == "a6") echo "<a href='processor1.php'><input type='button' action='/' name='Process Order' id='Process' value='Back'></a>";
if (
$size == "a4") echo "<a href='processor.php'><input type='button' action='processor.php' name='Process Order' id='Process' value='Process Order'></a>";
if (
$size == "a5") echo "<a href='processor.php'><input type='button' action='processor.php' name='Process Order' id='Process' value='Process Order'></a>";
if (
$size == "a6") echo "<a href='processor.php'><input type='button' action='processor.php' name='Process Order' id='Process' value='Process Order'></a>"

Now please dont bash me on this thread. I am the first to say i know bugger all about php and my code is messy..

EDIT

Sorry i should add. The problem was the buttons would show up but not do anything in IE8 but in FF they work fine.
(10-13-2009, 02:31 AM)DAMINK™ Wrote: [ -> ]<?php
$Colors = $_POST["Colors"];
$quantity = $_POST["quantity"];
$size = $_POST["size"];
?>
[/php]
Did you forgot the quotes.....

What error are you getting in IE, do you get any errors?
No errors. And the code you see is what i used actually.
The only problem is the script would run and produce the result but when the buttons appeared they would not do anything.
In FF they work fine. I mean the "back" button and the "Process Order" buttons.
I didn't found any error in the coding. may be IE not compatibility issue :-/
Yes thats what i put it down to also immi.
Still my client did not accept that. There answer was "well 99.9% of the net use IE8" lolol.
I had to inform them actually only 13% do and nearly 50% use FF but still the script failed and i looked quite the fool.
For the site in question i simply used a text link to replace the buttons in the result and that works in ie.
(10-13-2009, 02:41 AM)DAMINK™ Wrote: [ -> ]I had to inform them actually only 13% do and nearly 50% use FF but still the script failed and i looked quite the fool.

Only 13 % ? IMHO might some 70 + % people love to use IE 8
(10-13-2009, 02:31 AM)DAMINK™ Wrote: [ -> ]
PHP Code:
if ($size == "a4") echo "<a href='processor1.php'><input type='button' action='/' name='Process Order' id='Process' value='Back'></a>"

Yes the errors is within those lines, for IE this is an invalid code and IE doesn't know what to do with it.
I either recommend you to use <a> and style it with css as an button or to use only button, both are not good, not even for FF even tought it works.

I still recommend using the anchor tag only and put <img> of the button or use <div> inseda of <a> and style it with css
Code:
background:rgb(212,208,200);
border-top:2px solid rgb(255,255,255);
border-left:2px solid rgb(255,255,255);
border-right:2px solid rgb(128,128,128);
border-bottom:2px solid rgb(128,128,128);

edit:
You shouldn't insert <input> inside <a> tags, that's the same as
Code:
<a href="1.htm"><a href=2.htm">What to do!</a></a>
http://www.w3schools.com/browsers/browsers_stats.asp
Thats where i got my stats from actually.
(10-13-2009, 02:52 AM)NinjaGeek Wrote: [ -> ]Yes the errors is within those lines, for IE this is an invalid code and IE doesn't know what to do with it.
I either recommend you to use <a> and style it with css as an button or to use only button, both are not good, not even for FF even tought it works.

I still recommend using the anchor tag only and put <img> of the button or use <div> inseda of <a> and style it with css
Code:
background:rgb(212,208,200);
border-top:2px solid rgb(255,255,255);
border-left:2px solid rgb(255,255,255);
border-right:2px solid rgb(128,128,128);
border-bottom:2px solid rgb(128,128,128);

Yea i was going to use an image with a link but got pretty pissed off with client. Told them to stick the job up there ass lol.
Put a text link there and then signed off on the job. It was more just for curiosity regarding the problem.
DAMINK™ Wrote: [ -> ]Yea i was going to use an image with a link but got pretty pissed off with client. Told them to stick the job up there ass lol.
Put a text link there and then signed off on the job. It was more just for curiosity regarding the problem.

The problem is that you are using two types of almost same types of tags inside each other.
You could also create for every button new form and set buttons to submit and leave the anchor tag out of the lines, that would also solve the problem.
But never put input tags inside anchors, or vice versa.
Ahhhh good call Ninja. Cheers for that mate.