I have a form that needs to be submit into an iframe. It works perfectly in Windows and in some older version of Mac OS. But it doesn't works with the newer version. I have tested it with Mac OS X Mountain Lion 10.8.3 and it doesn't work. My users have reported same problem on different OS X version.
Here is the code:
<form action="https://nidieunimaitre.spreadshirt.com/shop/basket/addtobasket" style="padding: 0px;" method="post" target="formiframe" name="tshirt_form" id="tshirt_form">
<input type="hidden" name="product" id="productId" value="17695932"/>
<input type="hidden" name="article" id="articleId" value="7048248"/>
<input type="hidden" name="view" id="currentView7048248" value="351"/>
<input type="hidden" name="color" id="productColor7048248" value="2"/>
<input type="hidden" name="size" id="size" value="2"/>
<input type="hidden" name="quantity" id="quantity" value="1"/>
<a onclick="document.tshirt_form.submit()"
id="popupajouterpanier" href="#inlinepopupajouterpanier">Ajouter au panier</a>
<iframe src="" name="formiframe" id="formiframe" width="400" height="400"></iframe>
</form>
Or you can test it live on my website: http://www.ni-dieu-ni-maitre.com/mac.php
The form is supposed to add a t-shirt to a basket, then display the basket's page with the t-shirt that has just been added. With Windows, everything works perfectly. But with OS X 10.8.3, when you submit the form it will just load the basket's page into the iframe but the basket is still empty !! Looks like the form isn't sending the data correctly.
When i tested with OS X 10.8.3, the bug happened only with Safari. The form worked with Firefox. But some of my users have reported that the work didn't work under OS X no matter if they used Safari or Firefox.
Note that this is cross-domain (not sure if it matters). The page is sending the form's data to a different domain (spreadshirt.com's basket).
The form will work if i don't submit it into an iframe.
UPDATE: The form's action destination is spreadshirt.com basket. I just noticed that if i visit this page with Safari before submiting the form then it will work when submiting it to an iframe !!! Looks like Safari doesn't want to create the cookie if i don't visit spreadshirt.com site first. But i don't understand why it doesn't work with other browsers and why the bug only affect iframes... Any work-around ? According to another topic, it seems to be a cross-domain cookie problem: Setting cross-domain cookies in Safari
UPDATE #2: Setting Safari's configuration to never block cookies seems to solve the problem. Default was "block third party cookies". So any workaround for my situation, beside having to ask my users to change their settings ?