Which Form Embed Code Should I Use?
Right now Easy Forms offers two options for publishing a form in your web site:
Usually, the first option is the one you should use.
You can populate a field with URL parameters. Just make sure to use the Field ID or Field Alias as the parameter key, then the value assigned to this parameter will appear in the field.
Note: If you are using a Multi-Step Form, you can go to a specific page by appending the page number to the URL, for example to go to the second page add the “p=2” query string.
To be able to listen to the messages sent by the Form Widget, you simply have to add an event listener to your web page. For example, if you need to know a submission ID from your own webpage, you can add this code bellow the pasted embed code:
The Form Widget (embed code) has two parts:
The form widget allows you to set some options of the form on the fly:
'id': 132
'sid': 964
'container': 'c132'
'width': '100%'
'height': '846px'
'autoResize': !0
'theme': 1
'customJS': 1
'record': 1
'reset': 0
'page': 2
'addToOffsetTop': '-60'
Note that checkboxes and radio buttons will be selected with boolean values. For example:
The Form Widget contains many features and options that can be configured inside an external JavaScript File.
Note: To load a JavaScript File you must go to Forms -> Actions -> Settings -> UI Settings.
By default, a jQuery object is available. So you can interact with the Form in a very simple way by using the following lines of code:
The Form element - formEl - is a jQuery object to which you can access for get information and/or manipulate it directly. For example, we’re going to know the high of our form with the following lines of code:
Certain events are triggered when the Form does something.
A very basic example for detecting when a form fail would be:
The Rule Engine also triggers the following events when a field is shown or hidden by using conditional rules:
To implement this feature, the rule engine will trigger the following events:
Then, to interact with these events just write the event listeners. For example:
In addition to the events, Easy Forms offers two event handlers that allow you to go backward and forward a page on a Multi-Step form ready to use using JavaScript. For example, now we’re going to see how to forward a page without pressing the button “Next” using the auto-advance feature.
By default, when you create a Multi-Step Form, two navigation buttons are added automatically: “Previous” and “Next” at the bottom of the form. These buttons allow you to navigate through the form until you reach the last page where usually the Submit button is placed.
Note: Easy Forms lets you add multiple Submit buttons on different pages or parts of the form.
However, in certain use cases you can may want to advance directly to the next page without pressing any buttons. For this we will make use of the “nextStep” event handler.
Note: Some use cases in which this feature is useful are surveys and/or tests where is not allowed to change response and lets to complete the survey as soon as possible.
For example, with the following lines of code, we are going to tell our Form that each time a radio button is selected, the form will forward to the next page:
Finally, if you want to hide the navigation buttons you can add the following lines in the CSS Theme assigned to your form:
By having the jQuery object, we can make use of jQuery.when().done() to load multiple javascript objects and make use of them once they are ready to use. Let’s see the following example.
For example, with the following lines of code we will show a jQuery UI DatePicker in the Date fields of the form:
As you can see:
You can manage files sent with your forms. Basically file management allows to:
Important! When trying to update a Submission file made before the upgrade to version 1.3.6, older files will appear at the bottom of the list of uploaded files. You can remove them when you consider appropriate.
If your form has been configured to send confirmations or notifications by email, an Email button will appear in the Submission Details page. To resend any of these emails, just click on them and confirm you want to send.