Is it possible to interact with the DOM inside the iframe programmatically?

  • lk23j4lk234j
    Asked on June 21, 2024 at 4:35 AM

    Is it possible to interact with the DOM inside the iframe programmatically / artificially clicking elements within the iframe?

    Are there CORS / iframe limitations?

    Has this been done before using Jotforms?


    Thank you

  • Sonnyfer JotForm Support
    Replied on June 21, 2024 at 4:43 AM

    Hi Lukas,

    I'm not sure if I understood you correctly. Can you clarify what you mean by interacting with the DOM inside the iFrame programmatically? Also, I'm not well versed in CORs / iFrame limitation, but if you can share some more information about the limitations you're referring to, we'll be happy to forward to our backend team to get you an answer.

    Once we hear back from you, we'll be able to help you with this.

  • lk23j4lk234j
    Replied on June 21, 2024 at 4:46 AM

    Yes, that's correct.

    What I already have working: The user speaks and I have the transcription. Example: the user says "yes" and my website knows they said "yes". I'm not looking for advice on speech to text, it's already working.

    What I'm looking for now: I would like my website to parse the embedded jotform iframe for any elements that contain the word "yes", and click them. Then it should click the submit button.

    So I need way to interact with the iframe, because there is no API for the client side.

    So my user can effectively do the jotform hands free.


    Does that make sense?

  • Norwyn JotForm Support
    Replied on June 21, 2024 at 5:09 AM

    Hello Lukas,

    Thanks for getting back to us and for the additional details. I understand what you’d like to do, but I’ll need a bit of time to work out a solution. I’ll get back to you shortly.

    We appreciate your patience in the meantime.

  • lk23j4lk234j
    Replied on June 21, 2024 at 5:11 AM

    Great, thanks. Please ask if you need more info from me.

  • Norwyn JotForm Support
    Replied on June 21, 2024 at 8:17 AM

    Hi Lukas,

    Thanks for your patience. Currently, parsing data on an embedded form using iframe is unavailable. In this case, you can use the Source Code of the form and embed it to your website. Let me show you how to locate the source code:

    1. On the Form Builder page, click on the Publish tab on the orange navigation bar at the top.

    2. Go to the Embed section on the left pane.

    3. Then, look for the Source Code from the options. Click it and then copy the code.

    Is it possible to interact with the DOM inside the iframe programmatically? Image 1 Screenshot 20

    Give it a try and reach out to us again if you have more questions.

 
Your Answer