Auto populate fields with ?

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:

But it’s not populating them. If I go directly to the 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?

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=""
window.addEventListener &&
window.addEventListener("message", function(event){
    if (event.origin === ""){
        document.getElementById("ycbmiframemorespeech").style.height = + "px";
}}, false);

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 + "?" +;

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 = ''+'&'+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