Integration in PHP app

14 views
Skip to first unread message

Sorin Vasilescu

unread,
Aug 7, 2018, 3:12:53 PM8/7/18
to Orbeon Forms
Hi,

I'm trying to integrate a form in a PHP app using the linking functionality here: https://doc.orbeon.com/form-runner/link-embed/linking
It works, it's displaying the form into an iframe, but I have 2 issues:

1. I want the form to break out of the iframe when displaying the response

My understanding is that there's a "target" property that should work the same as an <a> element's target. I have this config made:
<property as="xs:string" name="oxf.fr.detail.process.save.test-app.*">
        require-valid
        then send(
            uri = "http://localhost/form-done",
            method = "POST",
            replace = "all",
            target = "_top"
        )
    </property>

The request to that URL is going through, but instead of replacing the content of the main page with the content of my URL, just the iframe content gets replaced.

Is that not how it's supposed to function, did I misunderstand?

2. I need to pass some stuff to the response URL, which I can supply to the form in the iframe, by any means, including adding <input> elements to the form with JavaScript, or anything.
I need the form runner to pass along those values to my destination URL, like in the POST variables or something. For example, I'm talking about a CSRF token value at the moment, but other stuff may be needed (userid in order to match the document id with the user, etc)

Is there anyway to do this?

Thanks,
Sorin.

Erik Bruchez

unread,
Aug 9, 2018, 6:57:14 PM8/9/18
to orb...@googlegroups.com
Sorin,

> Is that not how it's supposed to function, did I misunderstand?

I cannot rule out that there is a bug when using `target = "_top"` that's
probably never been tried before.

> I need to pass some stuff to the response URL, which I can supply to the
> form in the iframe, by any means, including adding <input> elements to the
> form with JavaScript, or anything.
I need the form runner to pass along those values to my destination URL,
like in the POST variables or something. For example, I'm talking about a
CSRF token value at the moment, but other stuff may be needed (userid in
order to match the document id with the user, etc)

The `uri` is actually a template, so you can pass parameters to it, for
example "

uri =
"http://localhost/form-done?foo={encode-for-uri(xxf:get-request-parameter('bar'))}"

When loading the form, pass `?bar=baz`, and that should be propagated.

You’ll let us know if this works for you!

Regards,

-Erik

--
Sent from: http://discuss.orbeon.com/

Erik Bruchez

unread,
Aug 9, 2018, 6:58:13 PM8/9/18
to orb...@googlegroups.com

Sorin Vasilescu

unread,
Aug 16, 2018, 11:32:40 AM8/16/18
to orb...@googlegroups.com
Hi, Erik,

Thanks for the reply, it was most helpful.

What you said about passing a variable was spot on, it works like a charm.
I was also able to circumvent the first issue through a JavaScript on that page that breaks out of the iframe. Would you like me to open a bug for that one?

Best regards,
Sorin.



--
You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orbeon/d8LIuhp9SMM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orbeon+un...@googlegroups.com.
To post to this group, send email to orb...@googlegroups.com.

Erik Bruchez

unread,
Aug 16, 2018, 1:02:14 PM8/16/18
to orb...@googlegroups.com
Great to hear!

Sure, please go ahead and enter an issue.
Reply all
Reply to author
Forward
0 new messages