How to know when user has pressed the submit button using an embedded iFrame form?

  • Profile Image
    Asked on May 18, 2016 at 03:04 PM

    I am embedding this into my website (using iframe currently). How can I tell when the user has pressed the submit button to capture that event?


  • Profile Image
    Answered on May 18, 2016 at 04:51 PM

    If I can understand you correctly, you're trying to capture the even when the submit button is clicked, this seems to be possible as per this link:

    I have tried to capture the click event of the submit button, but this does not seem to be possible when the page where the iFrame is loaded is not the same origin as the link in the iFrame, here is the error message I'm currently getting: 

    This seems to be a normal error, since it is a must that the all where the iFrame is being embedded needs to be the same as the link that loads in the iFrame, and this is due to security reasons, I found a link where this is explained as well, take a look here: 

    If you want to get the event when the submit button is clicked and trigger an action I would suggest you to use the source code instead, you will be able to handle elements in the form using your custom Javascript/jQuery code, here is a guide that will help you to get the source code: