phpiframeembedparameter-passingwufoo

Passing Params to Wufoo iframe


Ok so there are tons of examples on how to pass custom parameters hidden fields in Wufoo forms (in my case the current URL of the form). The problem is these all deal with the javascript embed code. I'm working with a company whos custom backend won't allow the js embed and therefore I must use the iframe embed method. I cannot for the life of me figure out how to do this. There are a couple frustratingly close examples that mention using PHP successfully but never show the actual implementation. Can anyone tell me how to do this or point me in the right direction?
Relevant info:

I currenlty have a field that is hidden using css. I want that field to be populated with the url or some part of the url it could be www.host.com/thepage or just /thepage as long as we can see where on the site the user submitted the form

http://help.wufoo.com/articles/en_US/SurveyMonkeyArticleType/URL-Modifications <- the page every post I've read mentions.
http://www.wufoo.com/forums/discussion/3349/how-to-pass-dynamic-value-into-embedded-forms/p1 <- example using php but with javascript embed method
Example iframe embed code:
<iframe height="763" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none" src="https://username.wufoo.com/embed/formid/"><a href="https://username.wufoo.com/forms/formid/">Fill out my Wufoo form!</a></iframe>


Solution

  • It seems the appropriate way is to use the URL method.

    Adding "def/" at the end of your src, then any arguments you wish to pass.

    For example, if I wanted to disable secure SSL, I'd use:

    <iframe height="763" allowTransparency="true" frameborder="0"
      scrolling="no" style="width:100%;border:none" 
      src="http://username.wufoo.com/embed/formid/def/secure=false">
      ...
    

    Additional parameters can be added using the '&' character. (note that I also changed https for http)

    In fact, if you already have a javascript example of what you want, the only thing javascript does is add this iframe for you, so if you can run it in your browser (by making a local HTML file, for example) using Inspect Element and navigating to the created iframe element, you can copy and paste the resulting code to your site, tweaking as desired.

    Regarding PHP, all they mean is to construct the URL using things like echo or print. For example:

    <iframe height="763" allowTransparency="true" frameborder="0"
      scrolling="no" style="width:100%;border:none" 
      src="https://username.wufoo.com/embed/formid/def/fieldx=<?php echo $the_url; ?>">