A lot of people use our forms on support portals and other areas that frequent logged in users. Since we already know the identity of the logged in user we can skip asking them for their info again, by pre-filling it.

The first step is to enable this feature. On the form edit screen go to Settings -> Others and check Pre-fill fields from URL attributes.

Now, there are two ways to embed FormCrafts forms: JavaScript code, and iFrame code.

JavaScript Embed Code

To find the JavaScript embed code click on Share / Embed on the form edit screen, and then click on Embed. Forms via JS code can further be embedded as inline forms or as popup forms. A sample embed code for inline forms looks like this:

<!-- FormCrafts JavaScript embed code -->
<script type='text/javascript'>var _fo=_fo?_fo:[];_fo.push({'c':'zkdzx','i':'ioaifqer','m':0,'s':0,'w':460}); if (typeof fce=='undefined') {var s=document.createElement('script');s.type='text/javascript'; s.async=true; s.src='https://formcrafts.com/js/fc.js'; document.body.appendChild(s);fce=1;}</script>
<div id='zkdzx' style='height:367px'></div>

Notice the part in bold ('i':'ioaifqer'). Say we have a field in our form labelled Your email, and we want to fill this with jack@example.com. We would modify the embed code, replacing the part in bold with: 'i':'ioaifqer?Your email=nish@ncrafts.net'. We could add another field as well: 'i':'ioaifqer?Your email=jack@example.com&Your name=Jack'. Notice the first field definition was preceded by ? and then subsequent ones with a &. Our embed code now becomes:

<!-- FormCrafts JavaScript embed code --> <script type='text/javascript'>var _fo=_fo?_fo:[];_fo.push({'c':'zkdzx','i':'ioaifqer?Your email=jack@example.com&Your name=Jack','m':0,'s':0,'w':460}); if (typeof fce=='undefined') {var s=document.createElement('script');s.type='text/javascript'; s.async=true; s.src='https://formcrafts.com/js/fc.js'; document.body.appendChild(s);fce=1;}</script> <div id='zkdzx' style='height:367px'></div>

iFrame Embed Code

To find the JavaScript embed code click on Share / Embed on the form edit screen, and then click on Other. IFrame embed codes are useful when your site software doesn't allow you to add JavaScript on the page. Our sample iFrame embed code looks like this:

<!-- FormCrafts iframe embed code -->
<iframe src='https://formcrafts.com/a/ioaifqer?iframe=true&resizer=false&innerHeight=370' width='460' height='370' style='max-width:100%;border:0;box-shadow: 0 0 0 .5px rgba(30, 30, 30, .1), 0px 1px 2px rgb(30, 30, 30, .08);border-radius:3px'></iframe>

Notice the URL in bold (https://formcrafts.com/a/ioaifqer?iframe=true&resizer=false&innerHeight=370). Say we have two fields in our form, labelled Your email and Your name and we want to fill them with jack@example.com and Jack, we would add &Your email=jack@example.com&Your name=Jack to the end of our URL, to make it: https://formcrafts.com/a/ioaifqer?iframe=true&resizer=false&innerHeight=370&Your email=jack@example.com&Your name=Jack

Using session or user info

Different content systems give you different ways to access user data. Example, the CMS might say that you can use {{email}} on the page to access user's email. In this case we could simply replace jack@example.com in the above examples with {{email}}.