# Auto populate fields with ?EMAIL=name@host.com

**URL:** https://forum.youcanbook.me/t/auto-populate-fields-with-email-name-host-com/897
**Category:** Miscellaneous
**Created:** [August 25, 2020, 4:40am UTC](https://forum.youcanbook.me/t/auto-populate-fields-with-email-name-host-com/897 "2020-08-25T04:40:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ClayN](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@ClayN](https://forum.youcanbook.me/u/ClayN)
#### Post date: [August 25, 2020, 4:41am UTC](https://forum.youcanbook.me/t/auto-populate-fields-with-email-name-host-com/897/1 "2020-08-25T04:41:00Z")

</div>

I thought I had this working and then it stopped.

I’ve got an embeded YCBM form and I load it with field values in ?Parameters:  
[http://www.bungalowsoftware.com/bookme/tour/index.aspx?EMAIL=clayN@BungalowSoftware.com&FNAMEPATIENT=Bubba&FNAME=Clay%20Nichols](http://www.bungalowsoftware.com/bookme/tour/index.aspx?EMAIL=clayN@BungalowSoftware.com&FNAMEPATIENT=Bubba&FNAME=Clay%20Nichols)

But it’s not populating them. If I go directly to the [Youcanbook.me](http://Youcanbook.me) page then it autopopulates as desired.

Is this just standard behavior or am I doing something wrong?

---

<div class="post-metadata">

### Author: ![tiffany](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/tiffany/32/77_2.png) [@tiffany](https://forum.youcanbook.me/u/tiffany)
#### Post date: [August 25, 2020, 10:56am UTC](https://forum.youcanbook.me/t/auto-populate-fields-with-email-name-host-com/897/2 "2020-08-25T10:56:59Z")

</div>

Hi Clay, when you are embedding the booking page, you need a bit of custom Javascript or PHP to dynamically update the iframe URL with the queries you are passing through. Your web developer should be able to get that script for you.

---

<div class="post-metadata">

### Author: ![ClayN](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@ClayN](https://forum.youcanbook.me/u/ClayN)
#### Post date: [September 8, 2020, 2:43pm UTC](https://forum.youcanbook.me/t/auto-populate-fields-with-email-name-host-com/897/3 "2020-09-08T14:43:14Z")

</div>

Can you provide an example of what Iframe needs?

---

<div class="post-metadata">

### Author: ![Jeremie](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/jeremie/32/267_2.png) [@Jeremie](https://forum.youcanbook.me/u/Jeremie)
#### Post date: [September 8, 2020, 5:27pm UTC](https://forum.youcanbook.me/t/auto-populate-fields-with-email-name-host-com/897/4 "2020-09-08T17:27:16Z")

</div>

@ClayN  
I don’t have time to provide you a working example, but I can tell you what to do. In your page, you use an `iframe` like this:

```auto
 <iframe src="https://morespeech.youcanbook.me/?noframe=true&skipHeaderFooter=true"
 id="ycbmiframemorespeech"></iframe><script>
window.addEventListener &&
window.addEventListener("message", function(event){
    if (event.origin === "https://morespeech.youcanbook.me"){
        document.getElementById("ycbmiframemorespeech").style.height = event.data + "px";
}}, false);
</script>

```

You are creating an `iframe` with a fixed link in the `src`. And then right after there is a script that makes changes to this `iframe`.

The only thing you need to do is change the `src` of the frame so that it contains the ?parameters from the form, so something like this:

```auto
var myFrame = document.getElementById("ycbmiframemorespeech");
myFrame.src = myFrame.src + "?" + window.location.search.substr(1);

```

This will append the GET parameters to the link of the frame.

---

<div class="post-metadata">

### Author: ![Ben](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.youcanbook.me/ben/32/772_2.png) [@Ben](https://forum.youcanbook.me/u/Ben)
#### Post date: [September 8, 2020, 5:52pm UTC](https://forum.youcanbook.me/t/auto-populate-fields-with-email-name-host-com/897/5 "2020-09-08T17:52:53Z")

</div>

Here you are @ClayN

```auto
var params = window.location.href.split('?')[1] || false; if ( params ) {var iframe = document.getElementById("ycbmiframeid");iframe.src = 'https://yoursubdomain.youcanbook.me/?noframe=true&skipHeaderFooter=true'+'&'+params;}

```

Replace the iframe ID with your id and the sub domain with your YCBM sub domain. You will add the above code right after the opening `<script>`
