---
title: Event Registration Form
product: PDF Generator
description: Get a printable event registration form in PDF. Create editable or prefilled student event registration forms with SurveyJS PDF Generator.
framework: Vanilla JS
source: https://surveyjs.io/pdf-generator/examples/pdf-education-event-registration-form-template/vanillajs
index: https://surveyjs.io/pdf-generator/examples/overview.md
---

# Event Registration Form (Vanilla JS)

## Files

### `public/index.html`

```html
<div style="display: flex;">
    <div id="surveyElement" style="flex: 1 1 0%; height: 100%; min-width: 0;"></div>
    <div id="pdf-preview" style="flex: 0.7 0.7 0%; display: none">
        <embed id="pdf-preview-frame" type="application/pdf" style="width:100%; height:100%;" />
    </div>
</div>
```

### `src/index.css`

```css
/* You can add your custom CSS here. */
```

### `src/index.js`

```js
import { Model } from "survey-core";
import "survey-js-ui";
import { SurveyPDF } from "survey-pdf";
import "survey-core/survey-core.min.css";
import "./index.css";
import { json } from "./json";

function createSurveyPdfModel (surveyModel) {
    const surveyPDF = new SurveyPDF(json);
    if (surveyModel) {
        surveyPDF.data = surveyModel.data;
        surveyPDF.locale = surveyModel.locale;
        
        
    }
    surveyPDF.questionsOnPageMode = "standard";
    return surveyPDF;
}
function saveSurveyToPdf (filename, surveyModel) {
    const pdfDoc = createSurveyPdfModel(surveyModel);
    if (!pdfDoc) return;

    pdfDoc.save(filename);
}

const previewDiv = document.getElementById("pdf-preview");
const previewEmbed = document.getElementById("pdf-preview-frame");
let pdfBlobUrl;

function showPdfPreview(surveyModel) {
    if (!previewDiv || !previewEmbed) return;

    const pdfDoc = createSurveyPdfModel(surveyModel);
    if (!pdfDoc) return;

    pdfDoc.raw("blob").then((blob) => {
        if (pdfBlobUrl) {
            URL.revokeObjectURL(pdfBlobUrl);
        }
        pdfBlobUrl = URL.createObjectURL(blob);
        previewEmbed.setAttribute("src", pdfBlobUrl);
        previewDiv.style.display = "block";
    });
}

function previewPdf(surveyModel) {
    if (!previewDiv) return;

    if (previewDiv.style.display !== "none") {
        previewDiv.style.display = "none";
        return;
    }

    showPdfPreview(surveyModel);
}

const survey = new Model(json);
survey.showCompleteButton = false;
survey.navigationButtonsLocation = "topBottom";
survey.addNavigationItem({
    id: "survey_save_as_file",
    title: "Download PDF",
    action: () => {
        saveSurveyToPdf("surveyResult.pdf", survey);
    }
});
survey.addNavigationItem({
    id: "survey_pdf_preview",
    title: "Preview PDF",
    visible: window.navigator.pdfViewerEnabled,
    action: () => {
        previewPdf(survey);
    }
});
survey.render(document.getElementById("surveyElement"));
```

### `src/json.js`

```js
export const json = {
  "title": "Event Registration Form",
  "pages": [
    {
      "name": "important-info",
      "title": "Important Information",
      "description": "Read the following information carefully and confirm that you understand it.",
      "elements": [
        {
          "type": "panel",
          "name": "important-info-panel",
          "elements": [
            {
              "type": "html",
              "name": "warning",
              "html": "<p><strong>Event Registration</strong></p><p>Events, activities, and meetings may not be registered more than four months in advance of the current date.</p><p>Recurring events with the same activities, equipment, and location may be registered using this form if they occur within four months of the current date.</p><p>Requests are processed during business hours only. Minimum submission timeframes are listed below. Complex events or events with large attendance should be submitted as early as possible.</p><p>Meetings requiring room or club space hire: 2 business days, subject to availability.</p><p>Event registration including outdoor or plaza bookings: 5 business days, subject to availability.</p><p>Equipment requiring staff assistance, for example large screens or BBQ delivery: 10 business days.</p><p>Sale of food prepared by your group: 10 business days.</p><p>Events with attendance over 150 guests: 10 business days plus 2 business days for each additional 50 guests.</p><p>Events involving intrastate or interstate travel, for example camping or excursions: 15 business days.</p><p>Specialized or high risk activities, for example rock climbing or off road mountain biking: 15 business days.</p><p>Events submitted without sufficient notice will not be approved. If any event details change, including location, equipment, or room hire, submit a new Event Registration Form within the required notice period.</p>"
            }
          ]
        },
        {
          "type": "boolean",
          "name": "intro-consent",
          "title": "I confirm that I have read and understand the information above.",
          "displayMode": "checkbox"
        }
      ]
    },
    {
      "name": "general-details",
      "title": "General Details",
      "description": "Provide the contact details of the event or activity manager.",
      "elements": [
        {
          "type": "text",
          "name": "name-host",
          "title": "Name of Host or Organization",
          "description": "Use the full name. Acronyms are not accepted."
        },
        {
          "type": "panel",
          "name": "panel-host",
          "title": "Host or Organization Email",
          "elements": [
            {
              "type": "text",
              "name": "host-org-email",
              "title": "Email address",
              "inputType": "email",
              "autocomplete": "email"
            },
            {
              "type": "text",
              "name": "confirm_email",
              "startWithNewLine": false,
              "title": "Confirm email address",
              "validators": [
                {
                  "type": "expression",
                  "text": "The confirmation email must match the email entered above.",
                  "expression": "{confirm_email}={host-org-email}"
                }
              ],
              "inputType": "email",
              "autocomplete": "email"
            }
          ]
        },
        {
          "type": "panel",
          "name": "panel-manager",
          "title": "Event or Activity Manager",
          "elements": [
            {
              "type": "text",
              "name": "first-name",
              "title": "First name"
            },
            {
              "type": "text",
              "name": "last-name",
              "startWithNewLine": false,
              "title": "Last name"
            }
          ]
        },
        {
          "type": "panel",
          "name": "panel-manger-email",
          "title": "Event or Activity Manager Email",
          "elements": [
            {
              "type": "text",
              "name": "enter-email-manager",
              "title": "Email address",
              "inputType": "email",
              "autocomplete": "email"
            },
            {
              "type": "text",
              "name": "confirm-email-manager",
              "startWithNewLine": false,
              "title": "Confirm email address",
              "validators": [
                {
                  "type": "expression",
                  "text": "The confirmation email must match the email entered above.",
                  "expression": "{confirm-email-manager}={enter-email-manager}"
                }
              ],
              "inputType": "email",
              "autocomplete": "email"
            }
          ]
        },
        {
          "type": "panel",
          "name": "phone-student-number",
          "elements": [
            {
              "type": "text",
              "name": "phone",
              "title": "Event or Activity Manager Mobile Number",
              "maskType": "pattern",
              "maskSettings": {
                "pattern": "+1(999)-999-99-99"
              }
            },
            {
              "type": "text",
              "name": "student-number",
              "startWithNewLine": false,
              "title": "Student Number",
              "maskType": "pattern",
              "maskSettings": {
                "pattern": "aa999999"
              }
            },
            {
              "type": "radiogroup",
              "name": "presence",
              "title": "Will the event or activity manager listed above be present for the entire event?",
              "choices": [
                "Yes",
                "No"
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "activity-details",
      "title": "Event or Activity Details",
      "description": "Provide details about the event, activity, or meeting.",
      "elements": [
        {
          "type": "radiogroup",
          "name": "name-event",
          "title": "Type of Event",
          "choices": [
            "Orientation Week",
            "Homecoming",
            "Graduation Ceremony",
            "Fresher Ball",
            "Sports Day",
            "Cultural Festival",
            "Academic Conference",
            "Career Fair",
            "Charity Event",
            "Art Exhibition"
          ],
          "showOtherItem": true,
          "otherText": "Other",
          "colCount": 2
        },
        {
          "type": "text",
          "name": "title-event",
          "title": "Title of Event or Activity",
          "maxLength": 50
        },
        {
          "type": "text",
          "name": "location",
          "title": "Event Location"
        },
        {
          "type": "radiogroup",
          "name": "attendance",
          "title": "Expected Attendance",
          "choices": [
            "1-50",
            "51-100",
            "101-200",
            "201-500",
            "More than 500"
          ],
          "colCount": 2
        },
        {
          "type": "comment",
          "name": "description",
          "title": "Description of the Event or Activity",
          "description": "Describe the purpose of the event and the planned activities.",
          "maxLength": 500,
          "autoGrow": true
        },
        {
          "type": "text",
          "name": "url",
          "title": "Event Web or Social Media Link, if applicable",
          "description": "For example a social media event page or ticket page. Leave blank if none.",
          "inputType": "url"
        },
        {
          "type": "paneldynamic",
          "name": "dates-times",
          "title": "Event Dates and Times",
          "panelCount": 3,
          "panelsState": "firstExpanded",
          "templateTitle": "Schedule {panelIndex}",
          "templateElements": [
            {
              "type": "text",
              "name": "date",
              "title": "Date",
              "inputType": "date",
              "minWidth": "auto"
            },
            {
              "type": "text",
              "name": "start-time",
              "title": "Start time",
              "inputType": "time",
              "startWithNewLine": false,
              "minWidth": "auto"
            },
            {
              "type": "text",
              "name": "end-time",
              "title": "End time",
              "inputType": "time",
              "startWithNewLine": false,
              "minWidth": "auto"
            }
          ]
        },
        {
          "type": "checkbox",
          "name": "requirements",
          "title": "Select any requirements for this activity.",
          "choices": [
            "I need to book a room or space",
            "I need to hire equipment",
            "I would like the university to promote this activity"
          ]
        },
        {
          "type": "boolean",
          "name": "acknowledgement",
          "title": "I confirm that I do not require equipment hire, room booking, or promotion. I understand that a new form must be submitted if my requirements change.",
          "description": "Select this only if none of the requirements above apply.",
          "displayMode": "checkbox"
        }
      ]
    },   
    {
      "name": "compliance-panel",
      "title": "Event Setup and Compliance Information",
      "description": "Provide information about event preparation and compliance requirements.",
      "elements": [
        {
          "type": "radiogroup",
          "name": "alcohol",
          "title": "Will alcohol be served at the event?",
          "choices": [
            "Yes",
            "No"
          ]
        },
        {
          "type": "panel",
          "name": "alcohol-statement",
          "title": "Alcohol Service Information",
          "description": "Complete this section if alcohol will be served.",
          "elements": [
            {
              "type": "html",
              "name": "statement-contents",
              "html": "<em>Outdoor events with alcohol must use a tent with sides. Events aimed at undergraduate students must not mention alcohol in advertising materials. Advertising may include the phrase Valid ID Required.</em>"
            },
            {
              "type": "boolean",
              "name": "alcohol-statement-confirmation",
              "title": "I confirm that I have read and understand the alcohol service rules.",
              "displayMode": "checkbox"
            }
          ]
        },
        {
          "type": "radiogroup",
          "name": "food",
          "title": "Will food be served at the event?",
          "choices": [
            "Yes",
            "No"
          ]
        },
        {
          "type": "panel",
          "name": "snacks-statement",
          "title": "Snack and Non Alcoholic Beverage Reminder",
          "description": "Complete this section if alcohol will be served. Snacks and non alcoholic beverages must be provided.",
          "elements": [
            {
              "type": "html",
              "name": "snacks-statement-contents",
              "html": "<em>Snacks and non alcoholic beverages must be served if alcohol is served.</em>"
            },
            {
              "type": "boolean",
              "name": "snacks-statement-confirmation",
              "title": "I confirm that I have read and understand this requirement.",
              "displayMode": "checkbox"
            }
          ]
        },
        {
          "type": "radiogroup",
          "name": "speaker-candidate",
          "title": "Will the event include a speaker who is a candidate for political office?",
          "choices": [
            "Yes",
            "No"
          ]
        },
        {
          "type": "radiogroup",
          "name": "against-candidate",
          "title": "Is the event expected to include statements supporting or opposing a political candidate or office holder?",
          "choices": [
            "Yes",
            "No"
          ]
        },
        {
          "type": "radiogroup",
          "name": "speaker",
          "title": "Will the event include another external speaker, entertainer, or presenter?",
          "choices": [
            "Yes",
            "No"
          ]
        },
        {
          "type": "text",
          "name": "name-speaker",
          "title": "Name of speaker, entertainer, or presenter, if applicable"
        },
        {
          "type": "radiogroup",
          "name": "amplified-music",
          "title": "Will the event include live or amplified music?",
          "choices": [
            "Yes",
            "No"
          ]
        },
        {
          "type": "panel",
          "name": "amplified-sound-statement",
          "title": "Amplified Sound Permit Information",
          "description": "Complete this section if the event includes amplified or live music.",
          "elements": [
            {
              "type": "html",
              "name": "permit",
              "html": "<p><strong>If the event is held outdoors, an Amplified Sound Permit from the local police department may be required.</strong></p><p>You will need an approved copy of this registration form to obtain the permit.</p>"
            },
            {
              "type": "boolean",
              "name": "amplified-sound-statement-confirmation",
              "title": "I confirm that I have read and understand the amplified sound permit requirements.",
              "displayMode": "checkbox"
            }
          ]
        },
        {
          "type": "radiogroup",
          "name": "displays",
          "title": "Will the event include signage or promotional displays?",
          "choices": [
            "Yes",
            "No"
          ]
        },
        {
          "type": "html",
          "name": "promotional-displays-statement",
          "title": "Rules for Signage and Promotional Displays",
          "html": "<em>No signage or promotional displays related to events may be attached to university buildings. All signage and promotional displays must be approved in advance as part of the event registration.</em>"
        },
        {
          "type": "comment",
          "name": "promotional-displays-contents",
          "title": "Provide details of signage or promotional displays, if applicable",
          "maxLength": 300
        },
        {
          "type": "radiogroup",
          "name": "insurance",
          "title": "Have the insurance requirements for this event been met?",
          "choices": [
            "Yes",
            "No"
          ]
        }
      ]
    },
    {
      "name": "declaration",
      "title": "Declaration",
      "elements": [
        {
          "type": "html",
          "name": "declaration-contents",
          "html": "<p>As the event manager, I agree to ensure that all applicable guidelines and health and safety requirements are followed during this event. I understand that late changes to equipment or room requirements may not be accommodated.</p>"
        },
        {
          "type": "boolean",
          "name": "declaration-confirmation",
          "title": "I confirm that I have read, understood, and agree to the declaration above.",
          "displayMode": "checkbox"
        }
      ]
    }
  ],
  "checkErrorsMode": "onValueChanged",
  "questionsOnPageMode": "singlePage",
  "headerView": "advanced"
};
```

### `src/theme.js`

```js
export const themeJson = {};
```

### `package.json`

```json
{
  "dependencies": {
    "survey-core": "latest",
    "survey-js-ui": "latest",
    "survey-pdf": "latest"
  }
}
```

## Other Frameworks

- [Angular](https://surveyjs.io/pdf-generator/examples/pdf-education-event-registration-form-template/angular.md)
- [React](https://surveyjs.io/pdf-generator/examples/pdf-education-event-registration-form-template/reactjs.md)
- [Vue 3](https://surveyjs.io/pdf-generator/examples/pdf-education-event-registration-form-template/vue3js.md)
- [jQuery](https://surveyjs.io/pdf-generator/examples/pdf-education-event-registration-form-template/jquery.md)
