---
title: Online Check-In Form
product: Form Library
description: Discover our free online check-in form template, complete with a ready-to-use code example for JavaScript. It showcases SurveyJS Creator's impressive features, such as a duplicate group option for registering multiple passengers at once and a smart form flow with conditional logic to display extra fields when passengers indicate connecting flights.
framework: jQuery
source: https://surveyjs.io/form-library/examples/online-check-in-form-template-free/jquery
index: https://surveyjs.io/form-library/examples/overview.md
---

# Online Check-In Form (jQuery)

<!-- cut -->

Online check-in forms allow passengers to check in for their flight, train, or bus without leaving the comfort of their homes or offices. This demo illustrates a typical online flight registration form. Form users can add multiple passengers, specify flight details, and leave contacts of a person to notify in case the trip is delayed or canceled. This form is created and designed using SurveyJS Survey Creator with an integrated Theme Editor. The following sections give an overview of this form's key solutions and describe how to implement them.

## Add a Background Image

The online flight check-in form in this demo has a distinct background image. With Theme Editor by SurveyJS, you can add background images to your forms with ease. Open the **Themes** tab in Survey Creator and switch to the **Background** category. Editors under the **Background image** title enable you to add a background image and configure its every aspect.

<img src="/Content/Images/examples/featured-demos/background-image.png" alt="Configure a background image in SurveyJS Theme Editor" width="100%">

These editors are mapped to the following theme JSON schema properties, which you can find in the `theme.js` file:

- [`backgroundImage`](https://surveyjs.io/form-library/documentation/api-reference/itheme#backgroundImage): `string`          
An image to display as form background. This property accepts a hyperlink or a data URL.

- [`backgroundImageFit`](https://surveyjs.io/form-library/documentation/api-reference/itheme#backgroundImageFit): `"auto"` | `"contain"` | `"cover"`            
A string value that specifies how to resize the background image to fit it into its container. Refer to the description of the [`background-size`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size#values) CSS property values on MDN for detailed information on the possible values.

- [`backgroundImageAttachment`](https://surveyjs.io/form-library/documentation/api-reference/itheme#backgroundImageAttachment): `"fixed"` | `"scroll"`          
A string value that specifies whether the background image is fixed in its position (as in this demo) or scrolled along with the survey.

- [`backgroundOpacity`](https://surveyjs.io/form-library/documentation/api-reference/itheme#backgroundOpacity): `number`      
A value from 0 to 1 that specifies how transparent the background image should be: 0 makes the image completely transparent, and 1 makes it opaque. In Theme Editor, the opacity values are mapped to a scale from 0% to 100%.

## Configure the Form Header

The header of your form typically contains a form title, short description, and a logo of your company. To specify title and description texts, open the Designer tab and enter them in the **Survey title** and **Survey description** editors in the **General** category.

<img src="/Content/Images/examples/featured-demos/survey-title-and-description.png" alt="Specify survey title and description in SurveyJS Survey Creator" width="100%">

To configure a logo, use editors in the **Logo in the Survey Header** category.

<img src="/Content/Images/examples/featured-demos/logo-settings.png" alt="Specify logo in SurveyJS Survey Creator" width="100%">

These editors are mapped to the following survey JSON properties:

- [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title)
- [`description`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description)
- [`logo`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logo)
- [`logoWidth`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logoWidth)
- [`logoHeight`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logoHeight)
- [`logoFit`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logoFit)

To configure the appearance of the form header, open the Themes tab and use editors in the **Header** category. Ensure that the **View** switch is set to "Advanced". All editors in the Header category, except font editors and View, are mapped to corresponding [`header`](https://surveyjs.io/form-library/documentation/api-reference/iheader) object properties in the theme JSON schema (see the `theme.js` file).

<img src="/Content/Images/examples/featured-demos/header-settings.png" alt="Configure form header in SurveyJS Theme Editor" width="100%">

## Use Placeholders for Form Field Titles

If you want to design more compact and neat-looking forms, you can hide form field titles and display title texts as input field placeholders. To implement this layout in your form, follow the steps below:

1. Open the Designer tab.
2. Select a question on the design surface.
3. In the Property Grid, switch to the **General** category.
4. Find and unselect the **Show the title and description** checkbox.
5. Enter the form field title in the **Placeholder text within input field** editor.

<img src="/Content/Images/examples/featured-demos/use-placeholders-instead-of-titles.png" alt="Set input field placeholder in SurveyJS Survey Creator" width="100%">

In the survey JSON schema, these editors are mapped to a question's [`titleLocation`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#titleLocation) and [`placeholder`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#placeholder) properties.

## Files

### `public/index.html`

```html
<div id="surveyElement" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-height: 100%; height:100%"></div>
```

### `src/index.css`

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

### `src/index.js`

```js
import $ from "jquery";
import { Model } from "survey-core";
import "survey-js-ui";
import "survey-core/survey-core.min.css";
import { themeJson } from "./theme";
import "./index.css";
import { json } from "./json";

const survey = new Model(json);
survey.applyTheme(themeJson);
survey.onComplete.add((sender, options) => {
    console.log(JSON.stringify(sender.data, null, 3));
});

$("#surveyElement").Survey({ model: survey });
```

### `src/json.js`

```js
export const json = {
 "title": "Online Check-in",
 "description": "Check-in is available 2 to 24 hours prior to departure for all destinations. To complete the check-in process, please fill out the form below.",
 "logo": "https://api.surveyjs.io/private/Surveys/files?name=ee96dc76-ecfb-4b17-8589-493015f1132a",
 "logoWidth": "auto",
 "logoHeight": "40",
 "completedHtml": "<div style=\"max-width:640px;text-align:center;margin:16px auto;\">\n\n<div style=\"padding:0 24px;\">\n<h4>Check-in complete.</h4>\n<p>Thank you for checking in. Your journey with us is all set. Have a great flight.</p>\n</div>\n\n</div>\n",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "paneldynamic",
     "name": "passengers",
     "width": "100%",
     "minWidth": "256px",
     "titleLocation": "hidden",
     "templateQuestionTitleLocation": "hidden",
     "templateElements": [
      {
       "type": "text",
       "name": "first-name",
       "width": "35%",
       "minWidth": "208px",
       "title": "PASSENGER #{panelIndex} INFO",
       "titleLocation": "top",
       "placeholder": "First name"
      },
      {
       "type": "text",
       "name": "last-name",
       "width": "30%",
       "minWidth": "172px",
       "startWithNewLine": false,
       "title": " ",
       "titleLocation": "top",
       "placeholder": "Last name"
      },
      {
       "type": "dropdown",
       "name": "prefix",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "title": " ",
       "titleLocation": "top",
       "choices": [ "Mr.", "Mrs.", "Ms." ],
       "choicesOrder": "random",
       "placeholder": "Prefix",
       "allowClear": false
      },
      {
       "type": "multipletext",
       "name": "birthdate",
       "width": "65%",
       "minWidth": "256px",
       "items": [
        {
         "name": "date",
         "inputType": "date",
         "title": "Date of birth"
        }
       ]
      },
      {
       "type": "text",
       "name": "nationality",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "placeholder": "Nationality"
      },
      {
       "type": "text",
       "name": "passport-number",
       "width": "100%",
       "minWidth": "256px",
       "title": "PASSENGER #{panelIndex} ID",
       "titleLocation": "top",
       "placeholder": "Passport #"
      },
      {
       "type": "dropdown",
       "name": "passport-issue-country",
       "width": "35%",
       "minWidth": "208px",
       "choicesByUrl": {
        "url": "https://surveyjs.io/api/CountriesExample",
        "valueName": "name"
       },
       "placeholder": "Country of issue",
       "allowClear": false
      },
      {
       "type": "multipletext",
       "name": "passport-exp-date",
       "width": "65%",
       "minWidth": "256px",
       "startWithNewLine": false,
       "items": [
        {
         "name": "date",
         "inputType": "date",
         "title": "Exp. date"
        }
       ]
      }
     ],
     "panelCount": 1,
     "minPanelCount": 1,
     "confirmDeleteText": "Do you want to delete the passenger?",
     "addPanelText": "ADD PASSENGER",
     "removePanelText": "REMOVE",
     "showProgressBar": false
    },
    {
     "type": "panel",
     "name": "person-to-notify",
     "elements": [
      {
       "type": "text",
       "name": "person-to-notify-first-name",
       "width": "35%",
       "minWidth": "208px",
       "title": "PERSON TO NOTIFY",
       "titleLocation": "top",
       "setValueIf": "{passengers[0].first-name} notempty",
       "setValueExpression": "{passengers[0].first-name}",
       "placeholder": "First name"
      },
      {
       "type": "text",
       "name": "person-to-notify-last-name",
       "width": "30%",
       "minWidth": "172px",
       "startWithNewLine": false,
       "title": " ",
       "titleLocation": "top",
       "setValueIf": "{passengers[0].last-name} notempty",
       "setValueExpression": "{passengers[0].last-name}",
       "placeholder": "Last name"
      },
      {
       "type": "dropdown",
       "name": "person-to-notify-prefix",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "title": " ",
       "titleLocation": "top",
       "setValueIf": "{passengers[0].prefix} notempty",
       "setValueExpression": "{passengers[0].prefix}",
       "choices": [ "Mr.", "Mrs.", "Ms." ],
       "choicesOrder": "random",
       "placeholder": "Prefix",
       "allowClear": false
      },
      {
       "type": "text",
       "name": "person-to-notify-email",
       "width": "65%",
       "minWidth": "256px",
       "inputType": "email",
       "placeholder": "Email"
      },
      {
       "type": "text",
       "name": "person-to-notify-phone",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "placeholder": "Phone"
      },
      {
       "type": "text",
       "name": "person-to-notify-address",
       "width": "100%",
       "minWidth": "256px",
       "title": "ADDRESS",
       "titleLocation": "top",
       "placeholder": "Address line 1"
      },
      {
       "type": "text",
       "name": "person-to-notify-city",
       "width": "35%",
       "minWidth": "208px",
       "placeholder": "City"
      },
      {
       "type": "text",
       "name": "person-to-notify-state",
       "width": "30%",
       "minWidth": "172px",
       "startWithNewLine": false,
       "placeholder": "State"
      },
      {
       "type": "text",
       "name": "person-to-notify-zip",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "placeholder": "Zip Code"
      },
      {
       "type": "dropdown",
       "name": "person-to-notify-country",
       "width": "100%",
       "minWidth": "256px",
       "choicesByUrl": {
        "url": "https://surveyjs.io/api/CountriesExample",
        "valueName": "name"
       },
       "placeholder": "Country",
       "allowClear": false
      }
     ],
     "questionTitleLocation": "hidden",
     "width": "100%",
     "minWidth": "256px"
    },
    {
     "type": "panel",
     "name": "flight",
     "elements": [
      {
       "type": "text",
       "name": "departure-booking-number",
       "width": "65%",
       "minWidth": "256px",
       "title": "DEPARTURE",
       "titleLocation": "top",
       "validators": [
        {
         "type": "regex",
         "text": "Your booking number must consist of exactly 6 digits.",
         "regex": "^\\d{6}$"
        }
       ],
       "maxLength": 6,
       "placeholder": "Please enter your 6-digit booking number"
      },
      {
       "type": "text",
       "name": "departure-flight-number",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "title": " ",
       "titleLocation": "top",
       "placeholder": "Flight #"
      },
      {
       "type": "multipletext",
       "name": "departure-date",
       "width": "65%",
       "minWidth": "256px",
       "items": [
        {
         "name": "date",
         "inputType": "date",
         "title": "Date"
        }
       ]
      },
      {
       "type": "multipletext",
       "name": "departure-time",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "items": [
        {
         "name": "time",
         "inputType": "time",
         "title": "Time"
        }
       ]
      },
      {
       "type": "dropdown",
       "name": "departure-country",
       "width": "65%",
       "minWidth": "256px",
       "title": "DEPARTING FROM",
       "choicesByUrl": {
        "url": "https://surveyjs.io/api/CountriesExample"
       },
       "placeholder": "Country",
       "allowClear": false
      },
      {
       "type": "text",
       "name": "departure-city",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "title": " ",
       "placeholder": "City"
      },
      {
       "type": "dropdown",
       "name": "destination-country",
       "width": "65%",
       "minWidth": "256px",
       "title": "DESTINATION",
       "titleLocation": "top",
       "choicesByUrl": {
        "url": "https://surveyjs.io/api/CountriesExample"
       },
       "placeholder": "Country",
       "allowClear": false
      },
      {
       "type": "text",
       "name": "destination-city",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "title": " ",
       "titleLocation": "top",
       "placeholder": "City"
      },
      {
       "type": "checkbox",
       "name": "connecting-flight",
       "width": "100%",
       "minWidth": "256px",
       "choices": [
        {
         "value": "true",
         "text": "I have a connecting flight"
        }
       ]
      },
      {
       "type": "multipletext",
       "name": "connecting-flight-date",
       "visibleIf": "{connecting-flight} = ['true']",
       "width": "65%",
       "minWidth": "256px",
       "items": [
        {
         "name": "date",
         "inputType": "date",
         "title": "Date"
        }
       ]
      },
      {
       "type": "multipletext",
       "name": "connecting-flight-time",
       "visibleIf": "{connecting-flight} = ['true']",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "items": [
        {
         "name": "time",
         "inputType": "time",
         "title": "Time"
        }
       ]
      },
      {
       "type": "text",
       "name": "connecting-flight-booking-number",
       "visibleIf": "{connecting-flight} = ['true']",
       "width": "65%",
       "minWidth": "256px",
       "title": "DEPARTURE",
       "validators": [
        {
         "type": "regex",
         "text": "Your booking number must consist of exactly 6 digits.",
         "regex": "^\\d{6}$"
        }
       ],
       "maxLength": 6,
       "placeholder": "Please enter your 6-digit booking number"
      },
      {
       "type": "text",
       "name": "connecting-flight-number",
       "visibleIf": "{connecting-flight} = ['true']",
       "width": "35%",
       "minWidth": "208px",
       "startWithNewLine": false,
       "placeholder": "Flight #"
      }
     ],
     "questionTitleLocation": "hidden",
     "width": "100%",
     "minWidth": "256px"
    }
   ]
  }
 ],
 "questionDescriptionLocation": "underInput",
 "questionErrorLocation": "bottom",
 "completeText": "Check In",
 "widthMode": "static",
 "width": "860"
};
```

### `src/theme.js`

```js
export const themeJson = {
    "backgroundImage": "https://api.surveyjs.io/private/Surveys/files?name=0e692c99-8fa6-4f8b-b06e-ded5f714d0c8",
    "backgroundImageFit": "cover",
    "backgroundImageAttachment": "fixed",
    "backgroundOpacity": 0.75,
  "cssVariables": {
    "--sjs-general-backcolor": "rgba(255, 255, 255, 0.25)",
    "--sjs-general-backcolor-dark": "rgba(248, 248, 248, 1)",
    "--sjs-general-backcolor-dim": "#197CE6",
    "--sjs-general-backcolor-dim-light": "rgba(255, 255, 255, 1)",
    "--sjs-general-backcolor-dim-dark": "rgba(243, 243, 243, 1)",
    "--sjs-general-forecolor": "rgba(0, 0, 0, 0.91)",
    "--sjs-general-forecolor-light": "rgba(0, 0, 0, 0.45)",
    "--sjs-primary-backcolor": "rgba(4, 91, 185, 1)",
    "--sjs-primary-backcolor-light": "rgba(255, 255, 255, 0.25)",
    "--sjs-primary-backcolor-dark": "rgba(4, 91, 185, 0.75)",
    "--sjs-primary-forecolor": "rgba(255, 255, 255, 1)",
    "--sjs-primary-forecolor-light": "rgba(255, 255, 255, 0.25)",
    "--sjs-base-unit": "8px",
    "--sjs-corner-radius": "4px",
    "--sjs-shadow-small": "0px 0px 0px 0px rgba(0, 0, 0, 0)",
    "--sjs-shadow-medium": "0px 2px 6px 0px rgba(0, 0, 0, 0.1)",
    "--sjs-shadow-large": "0px 8px 16px 0px rgba(0, 0, 0, 0.1)",
    "--sjs-shadow-inner": "0px 0px 0px 0px rgba(0, 0, 0, 0)",
    "--sjs-border-light": "rgba(255, 255, 255, 0.15)",
    "--sjs-border-default": "rgba(0, 0, 0, 0.25)",
    "--sjs-border-inside": "rgba(0, 0, 0, 0.16)",
    "--sjs-special-red": "rgba(229, 10, 62, 1)",
    "--sjs-special-red-light": "rgba(229, 10, 62, 0.1)",
    "--sjs-special-red-forecolor": "rgba(255, 255, 255, 1)",
    "--sjs-special-green": "rgba(25, 179, 148, 1)",
    "--sjs-special-green-light": "rgba(25, 179, 148, 0.1)",
    "--sjs-special-green-forecolor": "rgba(255, 255, 255, 1)",
    "--sjs-special-blue": "rgba(67, 127, 217, 1)",
    "--sjs-special-blue-light": "rgba(67, 127, 217, 0.1)",
    "--sjs-special-blue-forecolor": "rgba(255, 255, 255, 1)",
    "--sjs-special-yellow": "rgba(255, 152, 20, 1)",
    "--sjs-special-yellow-light": "rgba(255, 152, 20, 0.1)",
    "--sjs-special-yellow-forecolor": "rgba(255, 255, 255, 1)",
    "--font-family": "Open Sans",
    "--sjs-questionpanel-cornerRadius": "8px",
    "--sjs-editorpanel-hovercolor": "rgba(4, 91, 185, 1)",
    "--sjs-editorpanel-cornerRadius": "3px",
    "--sjs-font-pagetitle-color": "rgba(255, 255, 255, 1)",
    "--sjs-font-editorfont-color": "rgba(0, 0, 0, 0.9)",
    "--sjs-font-editorfont-placeholdercolor": "rgba(0, 0, 0, 0.5)",
    "--sjs-font-questiontitle-color": "rgba(255, 255, 255, 1)",
    "--sjs-font-questiondescription-color": "rgba(255, 255, 255, 0.75)",
    "--sjs-questionpanel-hovercolor": "rgba(255, 255, 255, 0.15)",
    "--sjs-font-questiontitle-weight": "700",
    "--sjs-font-questiontitle-size": "14px",
    "--sjs-font-questiondescription-size": "14px",
    "--sjs-font-editorfont-size": "14px",
    "--sjs-header-backcolor": "transparent",
    "--sjs-font-headertitle-color": "rgba(255, 255, 255, 1)",
    "--sjs-font-headertitle-size": "24px",
    "--sjs-font-headerdescription-color": "rgba(255, 255, 255, 1)",
    "--sjs-font-headerdescription-size": "14px",
    "--sjs-font-headerdescription-weight": "600",
    "--sjs-questionpanel-backcolor":  "rgba(255, 255, 255, 0.25)",
    "--sjs-font-headertitle-weight":  "700",
    "--sjs-font-pagetitle-weight":  "700"
  },
    "themeName": "default",
    "colorPalette": "light",
    "isPanelless": false,
    "header": {
        "height": 176,
        "textAreaWidth": 424,
        "inheritWidthFrom": "survey",
        "logoPositionX": "right",
        "logoPositionY": "top",
        "titlePositionX": "left",
        "titlePositionY": "bottom",
        "descriptionPositionX": "left",
        "descriptionPositionY": "bottom"
    },
    "headerView": "advanced"
};
```

### `package.json`

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

## Other Frameworks

- [Angular](https://surveyjs.io/form-library/examples/online-check-in-form-template-free/angular.md)
- [React](https://surveyjs.io/form-library/examples/online-check-in-form-template-free/reactjs.md)
- [Vue 3](https://surveyjs.io/form-library/examples/online-check-in-form-template-free/vue3js.md)
- [Vanilla JS](https://surveyjs.io/form-library/examples/online-check-in-form-template-free/vanillajs.md)
