Streaming live at 10am (PST)

Passing collection name to form field


#1

Hi folks,

I have a question. I have a collection page with a button to book a tour. This button leads to a booking form on another page. How could I pass the tour name to the booking form to pre-fill a text field within it? I'm guessing I might have to use jQuery to pre-fill the form but I don't know how to pass it the tour name.

Something like this:

<script>

$( document ).ready(function() {
    // after the page elements are all loaded, then run the script
    // Set the input field with unique ID #email to a value

    $("#tour-name").val('$tour-name');
    
    });
    
</script>

Does anyone know how I could do this within Webflow? Thanks for your help!


Use collection value as URL parameter
#2

1) Use embed component

2) Get one of these functions from the answers here


3) Set input field's value after the function




DEMO

http://sandbox-903b9c.webflow.io/post/blog-post-1


#3

You're awesome! Thank you