---
title: Pet Hotel Reservation Form
product: Form Library
description: Discover our ready-to-use pet hotel registration form template complemented with a free code example for JavaScript. The form showcases versatile form appearance settings, including custom fonts and background images configured in the CSS-based Theme Editor. Personalize the form completion page and navigation button texts to create a unique and user-friendly experience for pet owners.
framework: jQuery
source: https://surveyjs.io/form-library/examples/pet-hotel-reservation-form-template-free/jquery
index: https://surveyjs.io/form-library/examples/overview.md
---

# Pet Hotel Reservation Form (jQuery)

<!-- cut -->

A pet hotel reservation form allows pet owners to book accommodations and services for their pets at a pet hotel. The reservation form typically includes essential information about the pet (name, breed, age, medical history, and any special needs or instructions) and contact information of the pet owner. This demo shows an example of a pet hotel registration form that was fully created and designed using Survey Creator by SurveyJS. Refer to the sections below to learn how to implement this form's key features.

## Add a Background Image

The reservation form in this demo has a distinct background image. With Theme Editor integrated in Survey Creator, 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

A form header usually consists of a form title, short description, and a logo of your company. However, all these elements are optional. In this demo, the form header contains only a description and a logo. 

To specify a description text, open the **Designer** tab and enter your text in the **Survey description** editor within the **General** category.

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

To add and configure a logo for your form in Survey Creator, 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:

- [`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 position a description and logo within a form header, use Theme Editor integrated in Survey Creator. Switch to the **Themes** tab, open the **Header** category in Property Grid, and use the **Logo alignment** and **Survey description alignment** editors to align these elements as required. Ensure that the **View** switch is set to "Advanced".

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

You can also use other editors within the **Header** category to configure the form header in greater detail. 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).

## 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 = {
 "description": "4140 Parker Rd. Allentown, New Mexico +1 (319) 555-01-15",
 "logo": "https://api.surveyjs.io/private/Surveys/files?name=6e093d61-110b-4656-b079-aeed02cbd091",
 "logoWidth": "auto",
 "logoHeight": "64",
 "logoPosition": "right",
 "completedHtml": "<div style=\"max-width:560px;text-align:left;margin: 0 48px;align-self:flex-start;\">\n\n<h4>Thank you for registering your beloved pet.</h4>\n<br>\n<p>We genuinely appreciate your trust in Pet Hotel for the care and comfort of your cherished pet. Your registration is complete and your furry friend is all set for a wonderful stay.\n<br><br>\nRest assured, our dedicated team is fully prepared to ensure a safe, enjoyable, and pampered experience. If you have any specific requests, questions, or would like to discuss your pet's stay in more detail, please don't hesitate to reach out.\n<br><br>\nAt Pet Hotel, we consider every pet as part of our family, and we're committed to providing the best possible care. We eagerly await your pet's arrival and look forward to serving you.\n<br><br>\nWarmest regards,\n<br>\nPet Hotel.\n</p>\n\n</div>",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "text",
     "name": "first-name",
     "minWidth": "256px",
     "maxWidth": "28%",
     "title": "First Name"
    },
    {
     "type": "text",
     "name": "last-name",
     "minWidth": "256px",
     "maxWidth": "28%",
     "startWithNewLine": false,
     "title": "Last Name"
    },
    {
     "type": "text",
     "name": "address",
     "minWidth": "256px",
     "maxWidth": "55%",
     "title": "Address"
    },
    {
     "type": "text",
     "name": "city",
     "minWidth": "256px",
     "maxWidth": "28%",
     "title": "City"
    },
    {
     "type": "text",
     "name": "state",
     "minWidth": "144px",
     "maxWidth": "14%",
     "startWithNewLine": false,
     "title": "State"
    },
    {
     "type": "text",
     "name": "zip",
     "minWidth": "144px",
     "maxWidth": "14%",
     "startWithNewLine": false,
     "title": "Zip"
    },
    {
     "type": "text",
     "name": "phone",
     "minWidth": "256px",
     "maxWidth": "28%",
     "title": "Daytime Phone Number"
    },
    {
     "type": "text",
     "name": "email",
     "minWidth": "256px",
     "maxWidth": "28%",
     "startWithNewLine": false,
     "title": "Email Address"
    },
    {
     "type": "text",
     "name": "emergency-contact",
     "minWidth": "256px",
     "maxWidth": "28%",
     "title": "Emergency Contact"
    },
    {
     "type": "text",
     "name": "emergency-contact-phone",
     "minWidth": "256px",
     "maxWidth": "28%",
     "startWithNewLine": false,
     "title": "Phone Number"
    }
   ],
   "title": "PET PARENT"
  },
  {
   "name": "page2",
   "elements": [
    {
     "type": "text",
     "name": "pet-name",
     "minWidth": "256px",
     "maxWidth": "28%",
     "title": "Name"
    },
    {
     "type": "text",
     "name": "pet-sex",
     "minWidth": "144px",
     "maxWidth": "14%",
     "startWithNewLine": false,
     "title": "Sex"
    },
    {
     "type": "text",
     "name": "pet-neutered",
     "minWidth": "192px",
     "maxWidth": "14%",
     "startWithNewLine": false,
     "title": "Neutered?"
    },
    {
     "type": "text",
     "name": "pet-species",
     "minWidth": "256px",
     "maxWidth": "28%",
     "title": "Species"
    },
    {
     "type": "text",
     "name": "pet-breed",
     "minWidth": "256px",
     "maxWidth": "28%",
     "startWithNewLine": false,
     "title": "Breed"
    },
    {
     "type": "text",
     "name": "pet-color",
     "minWidth": "256px",
     "maxWidth": "28%",
     "title": "Color"
    },
    {
     "type": "text",
     "name": "pet-age",
     "minWidth": "144px",
     "maxWidth": "14%",
     "startWithNewLine": false,
     "title": "Age"
    },
    {
     "type": "text",
     "name": "pet-weight",
     "minWidth": "192px",
     "maxWidth": "14%",
     "startWithNewLine": false,
     "title": "Weight"
    }
   ],
   "title": "PET INFORMATION"
  },
  {
   "name": "page3",
   "elements": [
    {
     "type": "text",
     "name": "medical-conditions",
     "minWidth": "256px",
     "maxWidth": "28%",
     "title": "Medical Conditions"
    },
    {
     "type": "text",
     "name": "medications",
     "minWidth": "256px",
     "maxWidth": "28%",
     "startWithNewLine": false,
     "title": "Medications"
    },
    {
     "type": "text",
     "name": "previous-surgeries",
     "minWidth": "256px",
     "maxWidth": "55%",
     "title": "Previous Surgeries"
    },
    {
     "type": "text",
     "name": "food-brand",
     "minWidth": "256px",
     "maxWidth": "28%",
     "title": "Current Food Brand"
    },
    {
     "type": "text",
     "name": "dietary-needs",
     "minWidth": "256px",
     "maxWidth": "28%",
     "startWithNewLine": false,
     "title": "Special Dietary Needs"
    },
    {
     "type": "text",
     "name": "veterinarian",
     "minWidth": "256px",
     "maxWidth": "55%",
     "title": "Veterinarian"
    }
   ],
   "title": "MEDICAL HISTORY"
  }
 ],
 "questionTitleLocation": "left",
 "questionDescriptionLocation": "underInput",
 "questionErrorLocation": "bottom",
 "pagePrevText": "BACK",
 "pageNextText": "NEXT",
 "completeText": "REGISTER",
 "widthMode": "responsive",
 "width": "800"
};
```

### `src/theme.js`

```js
export const themeJson = {
    "backgroundImage": "https://api.surveyjs.io/private/Surveys/files?name=3efbab40-7440-4f08-b4d2-a5639663a2d6",
    "backgroundImageFit": "cover",
    "backgroundImageAttachment": "fixed",
    "backgroundOpacity": 1,
    "isPanelless": true,
  "cssVariables": {
    "--sjs-general-backcolor": "rgba(255, 255, 255, 1)",
    "--sjs-general-backcolor-dark": "rgba(248, 248, 248, 1)",
    "--sjs-general-backcolor-dim": "#F5FAFE",
    "--sjs-general-backcolor-dim-light": "rgba(255, 255, 255, 0)",
    "--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(0, 0, 0, 1)",
    "--sjs-primary-backcolor-light": "rgba(233, 240, 246, 1)",
    "--sjs-primary-backcolor-dark": "rgba(0, 0, 0, 1)",
    "--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": "inset 0px 0px 0px 2px rgba(0, 0, 0, 1)",
    "--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 1px 0px 0px rgba(0, 0, 0, 0.25)",
    "--sjs-border-light": "rgba(0, 0, 0, 0.09)",
    "--sjs-border-default": "rgba(0, 0, 0, 0.16)",
    "--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)",
    "--sjs-font-editorfont-placeholdercolor": "rgba(0, 0, 0, 0.25)",
    "--sjs-font-editorfont-size": "14px",
    "--sjs-editorpanel-backcolor": "rgba(255, 255, 255, 0)",
    "--sjs-editorpanel-hovercolor": "rgba(255, 255, 255, 1)",
    "--sjs-editorpanel-cornerRadius": "0px",
    "--sjs-font-editorfont-weight": "600",
    "--sjs-font-pagetitle-size": "16px",
    "--sjs-questionpanel-cornerRadius": "8px",
    "--sjs-font-pagetitle-color": "rgba(0, 0, 0, 1)",
    "--sjs-font-editorfont-color": "rgba(0, 0, 0, 1)",
    "--sjs-font-questiontitle-color": "rgba(0, 0, 0, 0.6)",
    "--sjs-font-surveytitle-weight": "800",
    "--sjs-font-pagetitle-weight": "600",
    "--sjs-font-questiontitle-size": "14px",
    "--sjs-font-questiondescription-size": "14px",
    "--sjs-font-questiontitle-weight": "400",
    "--sjs-questionpanel-hovercolor": "rgba(240, 245, 249, 1)",
    "--sjs-header-backcolor": "transparent",
    "--sjs-font-headerdescription-color": "rgba(0, 0, 0, 0.45)",
    "--sjs-font-headerdescription-size":  "14px",
    "--sjs-font-headertitle-weight":  "700"
  },
    "themeName": "default",
    "colorPalette": "light",
    "header": {
        "height": 144,
        "inheritWidthFrom": "container",
        "textAreaWidth": 256,
        "logoPositionX": "left",
        "logoPositionY": "top",
        "descriptionPositionX": "right",
        "descriptionPositionY": "top"
    },
    "headerView": "advanced"
};
```

### `package.json`

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

## Other Frameworks

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