Can I shorten this code?

User 2336860 Photo


Registered User
252 posts

On export in WFB you get the following code:


<script type="text/javascript">document.write(unescape("%3Ciframe id=\"fb_iframe\" src=\"contact_us.php" + window.location.search + "\" width=\"100%\" height=\"820\"allowtransparency=\"true\" scrolling=\"no\" frameborder=\"0\"%3E&lt;a href=\"contact_us.php\" title=\"contact_us\"&gt;Check out my CoffeeCup Form&lt;/a&gt;%3C/iframe%3E"));</script>
<noscript>
<iframe height="820" style="border:none; background:transparent; overflow:hidden; width:100%;"
id="fb_iframe" src="contact_us/contact_us.html">
&lt;a href="contact_us.php" title="contact_us"&gt;Check out my CoffeeCup
Form&lt;/a&gt;
</iframe>
</noscript>


Can this code be shortened to just be this:

<iframe height="820" style="border:none; background:transparent; overflow:hidden; width:100%;"
id="fb_iframe" src="contact_us/contact_us.html">
&lt;a href="contact_us.php" title="contact_us"&gt;Check out my CoffeeCup
Form&lt;/a&gt;
</iframe>


Will the form still work correctly?

Next up on my list...
Is there a way to put the form into a page in SCCP without it being in an iframe tag and have it show up on the page?

User 187934 Photo


Senior Advisor
20,193 posts

I use it like this all the time.:cool:
<iframe height="820" style="border:none; background:transparent; overflow:hidden; width:100%;" id="fb_iframe" src="contact_us/contact_us.html"></iframe>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2336860 Photo


Registered User
252 posts

Thanks, I thought it would be ok.
By chance do you know just what purpose the contact_us.php files has? It is generated by WFB, but if just using the shortened iframe code and directly referencing the contact_us.html skips it, what is it for?

User 38401 Photo


Senior Advisor
10,951 posts

I'm not an expert on anything that has to do with PHP, but I would say don't delete that one. The HTML file contains the "html" of the form, but the functioning of the form is on in the HTML, it's in the PHP and .js files so I'm sure that the PHP file has some of that functionality in it for your form to work.
User 187934 Photo


Senior Advisor
20,193 posts

Your correct Jo the myformname.php needs to stay.;) It's actually the backbone of the form processing.:) If you look at the top of your myformname.html you will see the form action="myformname.php".
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2336860 Photo


Registered User
252 posts

I see it there. Was not looking for it before. So then directly referencing the html like this as Eric posted:
<iframe height="820" style="border:none; background:transparent; overflow:hidden; width:100%;" id="fb_iframe" src="contact_us/contact_us.html"></iframe>
Is not a problem with the functionality of the form.

Then any ideas as to the whole script/noscript tags in the original code output by WFB (first code block in the first post in this thread).

Just trying to get my head wrapped around how SCCP and WFB work together. I'm currently neck deep in the CSS for one of the WFB themes to massage it into shape for the new look of my SCCP site when I put the update online.

User 187934 Photo


Senior Advisor
20,193 posts

I have hand coded lots of forms this way to use them on a site that I add custom JQuery/mysql dropdowns to and some other custom scripts. The original script tags trip up my custom scripts so I drop them.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.