Results 1 to 4 of 4

Thread: [RESOLVED] Buttons work in Firefox, but not IE

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    49

    Resolved [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!

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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

  3. #3
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    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.

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    49

    Resolved 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
  •  



Click Here to Expand Forum to Full Width