Question

Photo of Don Smallman

0

Setting Form Values Based on URL String

 Hi,

 

Does anyone know if it is possible to set a forms Values Based on URL String?  I someone clicks on a button on our site can I send them to the contact form and preset some of the form values, like "I Committed My Life To Christ"?

 Thanks! 

  • Photo of Jon Edmiston

    2

    The Workflow Entry block allows you to set inputs from the querystring like so:

    http://www.therockaz.org/ContactUs?FirstName=Ted%20Decker

    The querystring key would map to the workflow attribute's key. Is this what you were looking for?

  • Photo of Jim Michael

    0

    What kind of form? You can access the query parameters of the URL via lava like so

    {% assign queryParms = 'Global' | Page:'QueryString'  %} 
    Query Parms <br />
    {% for item in queryParms %}
             {% assign kvItem = item | PropertyToKeyValue %}
             {{ kvItem.Key }}: {{ kvItem.Value }} <br />
    {% endfor %}

    and I think you could reference those from your form, depending on where it is.

    • Jim Michael

      I'm not really sure, unfortunately... I haven't had time to look at the form but was just pointing out that the query parameters are available via Lava ;-) Hopefully someone who knows more can jump in and fill in the blanks.

    • Don Smallman

      Ah! I understand. Thanks for the info. Hopefully someone knows. It is not necessary, but would be helpful.