Hey all. Quick question. We have a CMS with a fo...
# cfml-beginners
n
Hey all. Quick question. We have a CMS with a form builder using CF. You can create forms that display on the web (in our cms). A client wants to embed one of our awesome forms on their website hosted on another platform. Anyone do that before? If so, how? I've been googling it but all the results are from form companies (jot form, google form, mailchimp, etc.) showing how to embed their forms. I'm not finding much on how to make this tech work on the back end.
a
"Stick it in an iframe"?
b
Generally this is done either with an embedded iFrame or with some html/javascript that you develop that creates the form and points it at your back end
a
The strategy that other vendors take to embed their forms is the same as you need to take. Just swap out
[their name]
for
[your name]
etc
m
Watch out for CORS/CSP issues!
n
@Adam Cameron @Mark Berning @bendur Thanks! Could it really be as easy as just an iframe? I always assumed that would have security or other problems. Would love to give that a try if it could really work. If both sites are inside separate ssl certs, is there any potential for conflict (ie if our form is protected by ssl1 and is iframed into a site protected by ssl2? How about displaying a separate thank you / success page after submission? Can that be handled within the iframe? I was assuming we'd have to do this the "modern" way with javascript or something, so that's sort of what I was hunting for. But, I'm not committed to that approach if there is an easier one.
a
I'd probably google "iframe ssl certs" to answer that specific question. I would guess it all "just works" (cos it's too obvious a thing to not "just work"), but I've never needed to know and hardly do any front-end work so you ought not listen to me. Except the bit about "google it". It'll be well-trod ground.
b
1. No, just make sure your certs are up to date. 2. Yes.
p
We came across this as a fancy way to integrate iFrames for a client of ours, with dynamic resizing. YMMV... http://davidjbradshaw.github.io/iframe-resizer/
n
@Patrick S Thanks, that looks interesting. Is it all custom javascript? I see a reference node js in there, so doe node need to be available on the server for this to work? or is that just an option? If you don't know, we can look at it. We're don't have node loaded.
p
It doesn't have any bindings to server side languages, it is purely JavaScript AFAIK... It took a few minutes getting a demo running when I last played around with it.