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

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

But it’s not populating them. If I go directly to the Youcanbook.me page then it autopopulates as desired.

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

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.

Can you provide an example of what Iframe needs?

@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:

 <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:

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.

Here you are @ClayN

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>

1 Like