Broadgun Forms Help

Contact

If you need help in any way please don't hesitate to contact Craig Broadbear from Broadgun Software.
email: craig@broadgun.com
phone: +61 387260105



Example Word documents containing forms

Job Application.docx
Photo Consent.docx

Download these files, login to forms.broadgun.com then upload them after you click the 'create new form' button. A web form will be automatically created for your use.


{{ Placeholders }}

Make sure your Word document contains placeholders. Placeholders are just plain text wrapped in curly braces. e.g. a placeholder called 'first name' would be {{first name}}.


Filters

You can optionally use filters on your placeholders to manipulate the data entered into the form and to specify what type of form field it should be.

e.g. 1
{{ amount | money }} will format the number amount as a currency in the PDF, such as $12.22

e.g. 2
{{ start_date | date Do MMMM YYYY }} will format the date like "3rd March 2019".

"Do" - the day
"MMMM" - the month
"YYYY" - the year

Custom Filters

In addition to the standard Nunjucks features the following custom filters are supported.

date filter

Formats a date. Takes as a parameter the desired output format. Uses the moment.js library.
e.g. date("output format")

The output format is described: moment output format

            Input:  The date is {{ startdate |  date MMMM Do YYYY }}
            Output: The date is March 3rd 2016
            
            Input:  The date is {{ startdate |  date YYYY-MM-DD }}
            Output: The date is 2016-03-03
            

money filter

Money formatter. Uses the accounting.js library .
The money filter optionally takes parameters :
currency symbol, precision, thousands separator, decimal separator, format

            Input:  The amount owed is {{ amount |  money }}
            Output: The amount owed is $1,230.00
            
            Input:  The amount owed is {{ amount  | money € 2 . ,}}
            Output: The amount owed is €1.230,00
            

number filter

Number formatter. Uses the accounting.js library .
The number filter optionally takes parameters :
precision, thousands separator, decimal separator

            Input:  The amount owed is $ {{ amount |  number }}
            Output: The amount owed is $ 1,230.00
            
            Input:  The amount owed is € {{ amount  | number 2 . , }}
            Output: The amount owed is € 1.230,00
            

max / min filters

If you want to control the maximum or minimum number of characters entered into a control then set one of these. e.g.

            {{ Address | max 50 }}
            A maximum of 50 characters is allowed.

            {{ Name | max 20 | min 3 }}
            A maximum of 20 characters is allowed and a minimum of 3 is required.

                    

multiline, checkbox, checklist, label, upload filters

These filters can be used to specify the form control type in the web form. Label filters are 'kept' in the Word file as well as used in the online form.

            {{description | multiline}}
                    

checkbox

Used to display a checkbox. Position the checkbox to the left of the text to set the default description of the label in the web form.

            {{agree | checkbox}} I agree to the terms and conditions
                    

In the above example, result in the PDF would show as follows, with either a checked or unchecked box depending on the selection made when filling out the form.
                         I agree to the terms and conditions

desc

If you want to override the default control field description.

            {{age | desc Please enter your age}}
                    

In the above example, the description label on the web form would be 'Please enter your age'.

            {{Your age | desc }}
            

In the above example, the description label on the web form would be 'Your age'.

keep

This filter can be used with Text fields to keep the text in the Word document. e.g.

            {{ Student ID | keep}}
            

This creates a text field called 'Student ID' in the web form. If the user responds with '10230781' the PDF has the text "Student ID 10230781"

$date, $datetime

These are special tags that are replaced with the current date or date and time. You can also apply date filters. e.g.

            Input:  The form was submitted on {{ $date }}
            Output: The form was submitted on 2019-04-03

            Input:  The form was submitted on {{ $date | date MMMM Do YYYY }}
            Output: The form was submitted on April 3rd 2019

            Input:  Date and time of form submission: {{ $datetime }}
            Output: Date and time of form submission: 2019-04-03 23:02

            Input:  Form completed on {{ $datetime | date "Do MMMM YYYY h:mm:ss a }}
            Output: Form completed on 2019-04-03 11:02:00 pm

            

{{ Options :yes:no }}

If your placeholder has options such as yes or no, you can provide those options in the word document next to the placeholder separated by the colon character. These options will mean the control will either be a radio group or a drop down select if the number of options is greater than 5.

e.g.

            Input:  Do you want lunch?  {{ lunch :YES:NO }}
            Output: Do you want lunch? YES

            Input:  What is your favorite color?  {{ color :orange:red:green:yellow:black }}
            Output: What is your favorite color?  yellow