|
-
Feb 22nd, 2009, 10:34 PM
#1
Thread Starter
Member
[RESOLVED] Buttons work in Firefox, but not IE
Hi guys,
I have a site that works in Firefox but not IE, argh.
Two buttons, (1) opens a popup window with a larger image, (2) another adds the product to the cart....
In IE, the popup button does nothing, just presses down like normal. And the cart button shows the image saying something has been added, but really its all lies, as when you go to the basket its empty.
Okay, code time....
1) "View Larger Image" popup window button, works fine in Firefox, except the page title is images.php rather then the page title, but thats no biggie.
PHP Code:
<form>
<input name="button" type="button" onClick="window.open('<?PHP echo "imagebig.php?productid=$productid"?>','Handle Bar Ends','width=485,height=340,directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,left=200,top=50,screenX=200,screenY=50');return false" value="View Large Image">
</form>
2) Add to cart ...... refreshes the page, performs some php code adding the item to the order table. Again works in Firefox, but not IE.
PHP Code:
<form name="<?php echo 'order'.$productid; ?>" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
<input name="quantity" type="text" id="quantity4" value="1" size="4" maxlength="3">
<input name="submit" type="submit" value="Add to Cart">
<input type=hidden name=productid value=<?PHP echo $productid;?>>
</form>
Any help is appreciated!
-
Feb 22nd, 2009, 11:41 PM
#2
Re: Buttons work in Firefox, but not IE
The issue you are having is not with PHP specifically. It is with the javascript and browser incompatibilities.
May i suggest using AJAX, then you can skip the popup all together, as some users may have a popup blocker.
Also, have you checked that Javascript is enabled in IE?
My usual boring signature: Something
-
Feb 23rd, 2009, 12:14 AM
#3
Re: Buttons work in Firefox, but not IE
For the javascript window problem, IE won't let you have a window with spaces in its name. Remove the spaces from the name by changing "Handle Bar Ends" to something like "handlebarends." Remember, this is your window's NAME and not title.
The only problem with your second form is that your "hidden" parameter is -after- your submit. If IE only processes the elements in the form -before- the submit button, then this will surely give you an issue. Other than that, there is no browser specific problem with the form. A form is a form, and as long as it doesn't have JavaScript within it, there should never be compatibility issues.
Also, AJAX isn't exactly an alternative to having an image preview window. And, any browser with a popup blocker worth having distinguishes between popups that are automatic, and ones that are opened by the user.
Last edited by kows; Feb 23rd, 2009 at 12:20 AM.
-
Feb 24th, 2009, 10:17 PM
#4
Thread Starter
Member
Re: Buttons work in Firefox, but not IE
Thanks dclamp and kows - I am not that familiar with AJAX so I did the option of changing the name to something_like_this and then it worked in IE - horrah!
So thats cool .... and yes it looks like the form is not the issue.... sometimes the cart works and sometimes it doesn’t. I think it has to do with whether a pre-existing session exists or something, I'm not too sure... so much problems argh...
So have decided to fix something that I thought worked but doesn't, will put it in another post since this one is resolved, thank you both 
New post: Order record (order table) not deleting once products have been removed from OrderItem table.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|