JCKN123's avatar

Form Target Iframe Issue on Safari

I have this code,

<form action="{{ route('paymentgateway1') }}" method="post" target="myiframe">
    @CSRF
    <input type="submit" value="Do Stuff!">
</form>

<iframe name="myiframe"></iframe>

This code is working fine on Firefox and Chrome. For safari, form target not reaching to iframe. it opens a new page and showing the iframe over there.

I'm trying to show the Payment form from CyberSource in laravel.

Any ideas on why this is happening and how to fix this issue

0 likes
5 replies
JCKN123's avatar

I tried that, but it same.. no luck :(

jlrdw's avatar

@jckn123 search for issues concerning iframes and Safari. I saw some, but wasn't sure which one if any applied to your use case.

JCKN123's avatar

I tried all the options i still got no luck..

laracoft's avatar

@jckn123

  1. Is paymentgateway1 on the same domain?
  2. If not, it could be CSRF issues, but unlikely since Firefox and Chrome worked
  3. Assuming it is not the same domain, why do you need a POST with CSRF?
  4. I just tested a GET on Safari 12.1.2 (14607.3.9) and it worked. What is your version?
<form action="{{ route('paymentgateway1') }}" method="get" target="myiframe">
    <input type="submit" value="Do Stuff!">
</form>
<iframe name="myiframe"></iframe>

Please or to participate in this conversation.