Dynamic content in forms

Could not agree more. Forms generally need some love and dynamism!

Knowing what page the form is sent on would be great, but better still would be being able to create a single contact form page and carry some context to it from the referring page (a value from a relevant collection like a contact name or area of interest).

In the meantime, I found this elsewhere on the forum from @cyberdave that lets us hack in the page URL into the form content:

In the embed, paste this code, which will dynamically create the hidden input field called pageURL and save the current url as part of the form data submitted:

In the embed, paste this code, which will dynamically create the hidden input field called pageURL and save the current url as part of the form data submitted:

<script type="text/javascript" language="JavaScript"><!--
document.write('<input ');
document.write('   type="hidden" ');
document.write('   name="pageURL" ');
document.write('   value="' + document.URL + '">');
//--></script>

When the user submits the form, the current url will get submitted.

(From Dynamic form field)

4 Likes