How to add additional fields to event submission form

January 4, 2022

IMPORTANT: All custom codes mentioned can be placed inside functions.php file in your theme. 

This tutorial will take you through the steps you need to add additional fields to the Action User event submission form. This should help you allow your event submitters to submit additional event data fields that are not supported in the default form. You will require Action User addon version 2.0 and higher for these steps to work. Let’s go!

Please follow the steps discussed below:

Include additional fields in the Action User form fields section

In the array, the field name we use “evotest” will be the identifier. Values inside the array are Field name, parameter, parameter, field type. You should see the newly added field when you head over to EventON > Action User > Form Fields:

First action hook we echo the HTML fields for the additional field we created evotest. So we are going to collect yes or no value for “Test Input Field” which has a parameter name evoau_test_value I am using the evo_helper() class and using the html_yesnobtn() function to output a neatly styles yes/no field on event submission form. You can type your own custom HTML in here instead. Moreover you can add more than one fields inside evoautest_fields() function.

Next is where we save the values — from evoautest_save_values() function. You can see our input field evoau_test_value is inside the foreach array. If you decide to show more than one fields on event submission form be sure to add all the field parameter names inside this array so each of those values can be saved.

Also for the label text for our additional data field we are using evo_lang_get() function with a parameter name that is associated with that text string in EventON Language — which is explained below.

The above codes will show new yes no field in the event submission form.


Alternative File Upload Field

The below code snippet allows you to add an upload file field to the Action User submission field.

In this example, we are making it possible for users to upload PDF files with the event submission form. During the submission process, we upload the file into the WordPress system and save the attachment ID into event post meta (var name: pdf_file)

Optional Translation

This next part is optional. It is for including the label text we used in our additional field to show in EventON > Language settings so it can be translated easily.

Displaying the Field value in Event Edit Page

Below code shows you how to show the submitted value in backend event edit page.

This code should either show the submitted value or the default text if no value is submitted on the event edit page as below.

Did this article help you? If not, send us a ticket via helpdesk

Ready to setup your calendar?