---
title: Grant Application Form
product: PDF Generator
description: Get a printable grant application form in PDF. Create editable or prefilled grant request forms using SurveyJS PDF Generator.
framework: Vanilla JS
source: https://surveyjs.io/pdf-generator/examples/template-grant-application-form-template/vanillajs
index: https://surveyjs.io/pdf-generator/examples/overview.md
---

# Grant Application 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;
        
        
    }
    
    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": "Grant Application Form for NPO",
  "pages": [
    {
      "name": "contact-information",
      "title": "1. Contact Information",
      "elements": [
        {
          "type": "text",
          "name": "contact-information-name",
          "title": "Name"
        },
        {
          "type": "text",
          "name": "contact-information-reg-number",
          "startWithNewLine": false,
          "title": "Organization registration number or date of birth"
        },
        {
          "type": "text",
          "name": "contact-information-address",
          "title": "Postal address"
        },
        {
          "type": "text",
          "name": "contact-information-municipality",
          "title": "Municipality"
        },
        {
          "type": "text",
          "name": "contact-information-county",
          "startWithNewLine": false,
          "title": "County"
        },
        {
          "type": "text",
          "name": "contact-information-tel",
          "title": "Telephone number including country and area codes"
        },
        {
          "type": "text",
          "name": "contact-information-fax",
          "startWithNewLine": false,
          "title": "Fax number including country and area codes (if applicable)"
        },
        {
          "type": "text",
          "name": "contact-information-email",
          "title": "Email address",
          "inputType": "email"
        },
        {
          "type": "text",
          "name": "contact-information-website",
          "startWithNewLine": false,
          "title": "Website (if applicable)",
          "inputType": "url"
        },
        {
          "type": "text",
          "name": "contact-information-contact-person",
          "title": "Contact person (project manager, if applicable)"
        }
      ]
    },
    {
      "name": "applicant-details",
      "title": "2. Information About the Applicant",
      "elements": [
        {
          "type": "boolean",
          "name": "VAT",
          "displayMode": "checkbox",
          "title": "Registered for VAT"
        },
        {
          "type": "boolean",
          "name": "registered-employer",
          "displayMode": "checkbox",
          "title": "Registered as an employer",
          "startWithNewLine": false
        },
        {
          "type": "text",
          "name": "vat-number",
          "title": "VAT registration number",
          "description": "Complete if the applicant is registered for VAT."
        },
        {
          "type": "boolean",
          "name": "bankruptcy",
          "displayMode": "checkbox",
          "title": "The applicant is in a state of bankruptcy, under administration, or has debts for taxes or social security contributions"
        },
        {
          "type": "checkbox",
          "name": "use",
          "title": "The grant will be used for the following activities (if applicable)",
          "choices": [
            {
              "value": "business",
              "text": "Business activity"
            },
            {
              "value": "vat",
              "text": "Activity that requires filing VAT returns"
            }
          ]
        },
        {
          "type": "radiogroup",
          "name": "organization-form",
          "title": "Organizational form",
          "colCount": 2,
          "showOtherItem": true,
          "choices": [
            "Non-profit organization",
            "Foundation",
            "Limited company",
            "Registered religious community"
          ]
        },
        {
          "type": "text",
          "name": "operational-focus",
          "title": "Organization's operational focus"
        },
        {
          "type": "text",
          "name": "foundation-date",
          "startWithNewLine": false,
          "title": "Date the organization was formed",
          "inputType": "date"
        },
        {
          "type": "text",
          "name": "number-members",
          "title": "Number of members",
          "inputType": "number"
        },
        {
          "type": "text",
          "name": "number-employees",
          "startWithNewLine": false,
          "title": "Number of employees",
          "inputType": "number"
        },
        {
          "type": "paneldynamic",
          "name": "board-members",
          "title": "Board members or management representatives",
          "panelCount": 3,
          "panelsState": "firstExpanded",
          "templateTitle": "Member {panelIndex}",
          "addPanelText": "Add member",
          "templateElements": [
            {
              "type": "text",
              "name": "name",
              "title": "Name"
            },
            {
              "type": "text",
              "name": "address",
              "title": "Address",
              "startWithNewLine": false
            },
            {
              "type": "text",
              "name": "telephone",
              "title": "Telephone number",
              "inputType": "phone"
            },
            {
              "type": "text",
              "name": "email",
              "title": "Email address",
              "startWithNewLine": false,
              "inputType": "email"
            }
          ]
        }
      ]
    },
    {
      "name": "grant-details",
      "title": "3. Grant Information",
      "elements": [
        {
          "type": "text",
          "name": "grant-details-name",
          "title": "Name of the grant"
        },
        {
          "type": "text",
          "name": "grant-details-reference-number",
          "startWithNewLine": false,
          "title": "Government Offices reference number"
        },
        {
          "type": "text",
          "name": "grant-details-ministry",
          "title": "Ministry responsible for approving the grant (if known)"
        },
        {
          "type": "text",
          "name": "grant-details-amount",
          "startWithNewLine": false,
          "title": "Amount requested"
        }
      ]
    },
    {
      "name": "planned-activities",
      "title": "4. Planned Activities",
      "elements": [
        {
          "type": "comment",
          "name": "purpose",
          "title": "Purpose and objectives of the planned activities"
        },
        {
          "type": "comment",
          "name": "target-groups",
          "title": "Target groups"
        },
        {
          "type": "comment",
          "name": "planned-activities-question",
          "title": "Describe the planned activities"
        },
        {
          "type": "comment",
          "name": "own-contribution",
          "title": "Describe the applicant's own contribution to the activities"
        },
        {
          "type": "comment",
          "name": "need",
          "title": "Explain the need for the planned activities"
        },
        {
          "type": "panel",
          "name": "period",
          "title": "Period during which the activities will be carried out",
          "elements": [
            {
              "type": "text",
              "name": "from",
              "title": "From",
              "inputType": "date"
            },
            {
              "type": "text",
              "name": "to",
              "startWithNewLine": false,
              "title": "To",
              "inputType": "date"
            }
          ]
        },
        {
          "type": "comment",
          "name": "gender",
          "title": "How will gender equality be considered in the planned activities?"
        },
        {
          "type": "paneldynamic",
          "name": "collaborations",
          "title": "Collaborating organizations or institutions (if applicable)",
          "panelCount": 3,
          "panelsState": "firstExpanded",
          "templateTitle": "Collaboration {panelIndex}",
          "addPanelText": "Add collaboration",
          "templateElements": [
            {
              "type": "text",
              "name": "organization",
              "title": "Organization or institution"
            },
            {
              "type": "comment",
              "name": "collaboration-description",
              "title": "Describe the collaboration",
              "rows": 2
            }
          ]
        },
        {
          "type": "comment",
          "name": "part",
          "title": "If only part of the grant is awarded, which activities will still be carried out?"
        }
      ]
    },
    {
      "name": "skills",
      "title": "5. Skills and Experience",
      "elements": [
        {
          "type": "comment",
          "name": "skills-prospects",
          "title": "Describe the applicant's ability to carry out the proposed activities"
        },
        {
          "type": "comment",
          "name": "skills-activities",
          "title": "Describe similar activities that have previously been conducted"
        },
        {
          "type": "file",
          "name": "skills-ani-corruption",
          "title": "Attach the applicant's anti-corruption policy or an equivalent document (if available)",
          "waitForUpload": true
        },
        {
          "type": "file",
          "name": "skills-risk-analysis",
          "startWithNewLine": false,
          "title": "Attach the applicant's risk analysis for the proposed activities (if available)",
          "waitForUpload": true
        },
        {
          "type": "comment",
          "name": "skills-other-information",
          "title": "Other information that supports the applicant's ability to carry out the activities"
        }
      ]
    },
    {
      "name": "references",
      "title": "6. References",
      "elements": [
        {
          "type": "paneldynamic",
          "name": "references-panel",
          "title": "References",
          "panelCount": 3,
          "panelsState": "firstExpanded",
          "templateTitle": "Reference {panelIndex}",
          "addPanelText": "Add reference",
          "templateElements": [
            {
              "type": "text",
              "name": "name",
              "title": "Name"
            },
            {
              "type": "text",
              "name": "address",
              "title": "Address",
              "startWithNewLine": false
            },
            {
              "type": "text",
              "name": "telephone",
              "title": "Telephone number",
              "inputType": "phone"
            },
            {
              "type": "text",
              "name": "email",
              "title": "Email address",
              "startWithNewLine": false,
              "inputType": "email"
            }
          ]
        }
      ]
    },
    {
      "name": "other-information",
      "title": "7. Other Information",
      "elements": [
        {
          "type": "comment",
          "name": "other-information-box",
          "title": "Provide any additional information that may support this application"
        }
      ]
    }
  ],
  "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/template-grant-application-form-template/angular.md)
- [React](https://surveyjs.io/pdf-generator/examples/template-grant-application-form-template/reactjs.md)
- [Vue 3](https://surveyjs.io/pdf-generator/examples/template-grant-application-form-template/vue3js.md)
- [jQuery](https://surveyjs.io/pdf-generator/examples/template-grant-application-form-template/jquery.md)
