bootstrap3formtemplates
v1.9.3
Published
Bootstrap 3 Form Templates in support of DOIFORMS
Downloads
22
Maintainers
Readme
Introduction
Form Templates in support of doiforms
Getting Started
Installation process
install from npm using "npm i doiforms"
to install the template form library run "npm i bootstrap3formtemplates"
Software dependencies
- React
- doiforms
- react-date-picker
- react-datetime-picker
- google-libphonenumber
API references Basic usage looks something like this:
import { FormTemplate } from "bootstrap3formtemplates";
import {
DOIFormComponent,
EnumFieldType,
IFieldState,
} from "doiforms";
import * as React from "react";
export default function MyForm(): JSX.Element{
const field = {
DisplayName: "Your Name",
Id: "name",
Name: "name",
Order: 0,
Required: true,
Type: EnumFieldType.text };
const submit = {
DisplayName: "Submit",
Id: "submitb",
Name: "submitb",
Order: 1,
Required: true,
Type: EnumFieldType.submit
};
return <DOIFormComponent
ErrorHandler={(ErrorMessage?: string, Stack?: string) => <h1>{ErrorMessage || "Error"}</h1><p>{Stack}</p>}
Fields={[field,submit]}
FormTemplate={FormTemplate}
RedirectURL={"https://localhost"}
SubmitAction={() => {
return new Promise<void>(
(resolve: () => void, reject: (reason: any) => void) => {
resolve();
});
}} />;
}