This document is for an older version of

Freeform

.

View latest version →

User Guides

Multiple Instances of the Same Form

You certainly can have more than 1 Freeform form loaded in the same page. However, in some cases you may run into issues when doing so, such as AJAX not working correctly or some special fields not loading correctly.

Instructions

If you experience any issues (or would like to prevent any from potentially occuring), you can do so by following these best practices:

  • Be sure to specify the id parameter for the freeform.form template functions in your template with unique values.
  • Be sure to use the fieldIdPrefix parameter for the freeform.form template functions in your template with unique values. This will automatically insert unique prefix values to field ID's rendered with field.render so you don't have to manually do this.

Example





 
 
 
 


 
 
 
 



<html>
<head></head>
<body>
    <h1>First Instance of Form</h1>
    {{ craft.freeform.form("myFormHandle").render({
        id: "form-one",
        fieldIdPrefix: "form-one-"
    }) }}

    <h1>Second Instance of Form</h1>
    {{ craft.freeform.form("myFormHandle").render({
        id: "form-two",
        fieldIdPrefix: "form-two-"
    }) }}
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16