Global Form Macros

Global Form Macros is a JetFormBuilder feature that allows you to use the value of some field in the layout of another block.

You can add the <!–JFB_FIELD::field_name–> macro inside the HTML tag or add it to one of these attributes:

  • href;
  • src;
  • alt;
  • title.

Contents:

How to Add the Form Macros to the Buttons Block

For instance, if you want to add the form macros to the Buttons block, it’s better to do it via the “Edit as HTML” button.

edit as HTML button

Paste the <!–JFB_FIELD::field_name–> macro into HTML before closing </a> tag. Change the field_name to the actual name of the field from where you want to get the value.

adding macros into the HTML code

For example, we have entered the name of the checkbox field “kind,” where the user can check the kind of trip.

Proceeding to the front end, we can see the button in the form with the “Read more about” text.

buttons block on the front end

If you check an option from the checkbox, it will be shown in the button. If you choose several options, they will be separated by commas. You can add the page link to the button with the information about all trips so that the users can find out about the needed trip.

buttons block with the macros on the front end

How to Add the Form Macros to the Label of the JetForm Fields

If you need to place form macros into the label or description of some JetForm fields, we do not recommend you add it via inline editing because the symbols will be transformed, and you’ll get the invalid macro on the front end.

jetform fields inline editing

So, it’s better to enter the form macro in the Field Label. Feel free to enter as many form macros with the field names as you need. You can also mix form macros with the plain text like that: price per night: <!–JFB_FIELD::price–> $. It will look on the front end like that: price per night: 170 $.

form macros in the field label

With these settings, users can see the values at the end of the form they have chosen. Such settings can also be applied to the multi-step form so that users can see all their choices at the last step before submitting the form.

form macros in the field label on the front end

Such a way also works with the Action Button block since it cannot be edited as HTML. We have added the macro of the Text Field in the Field Label of the Action Button.

submit button with a macro

When users enter the text into the Text Field, the same text is shown in the Action Button on the front end.

submit button with macros front end

That’s it. You know now how to add value from the JetForm field by using the global form macros.