Gets information about the event's registration form and status.
The returned FormData
object contains the information you need to create
a custom registration form for the specified event.
This information includes:
Note: To work with the Wix Events API, you need to publish your site.
import wixEventsFrontend from "wix-events-frontend";
// ...
const eventId = // Get the event ID
wixEventsFrontend.getForm(eventId).then((form) => {
let formData = form.formData;
let fields = formData.formInputs;
let firstFieldName = fields[0].name;
let statusOptions = formData.rsvpStatusOptions;
let registrationStatus = formData.registrationStatus;
let isTicketed = formData.isTicketed;
});
/* formData:
*
* {
* "rsvpStatusOptions": "YES_AND_NO,
* "registrationStatus": "OPEN_RSVP",
* "isTicketed": false,
* "formInputs": [
* {
* "_id": "37a5789b-27d1-43a3-703b-a93dedad5b01",
* "additionalLabels": [],
* "array": false,
* "controlType": "NAME",
* "label": "First Name",
* "required": true,
* "maxLength": 50,
* "name": "firstName",
* "options": []
* },
*
* ...
*
* {
* "_id": "27d5789b-137a-43ed-a33d-a9703bad5b01",
* "additionalLabels": [
* {
* "name": "one",
* "label": "I'm bringing a plus one"
* },
* {
* "name": "multiple",
* "label": "Additional Guests"
* }
* ],
* "array": false,
* "controlType": "GUEST_CONTROL",
* "label": "I'm bringing a plus one",
* "required": true,
* "maxLength": 0,
* "name": "additionalGuests",
* "options": [
* "0",
* "1"
* ]
* }
* ]
* }
*/