# hapiform.js

> Javascript library of Hapi Form.

Latest version **1.0.9** (published 2021-12-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install hapiform.js
pnpm add hapiform.js
yarn add hapiform.js
bun add hapiform.js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2021-12-06 |
| First published | 2021-11-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 50.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Cheng Huichao |
| Maintainers | chenghuichao |
| Keywords | hapiform, hapi form, activa media |

## Links

- npm: https://www.npmjs.com/package/hapiform.js
- Repository: https://github.com/cheng-huichao/hapiform-js
- Homepage: https://github.com/cheng-huichao/hapiform-js#readme
- Issues: https://github.com/cheng-huichao/hapiform-js/issues
- npm.io page: https://npm.io/package/hapiform.js

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.9 (latest) — 2021-12-06
- 1.0.8 — 2021-12-06
- 1.0.7 — 2021-11-25
- 1.0.6 — 2021-11-22
- 1.0.5 — 2021-11-22
- 1.0.4 — 2021-11-22
- 1.0.3 — 2021-11-22
- 1.0.2 — 2021-11-22
- 1.0.1 — 2021-11-20
- 1.0.0 — 2021-11-20

## README

## javascript library of Hapi Form

```bash
npm i hapiform.js or yarn add hapiform.js
```


### For ESM usage

```javascript

import {hapiForm} from 'hapiform.js';

hapiForm.setup([
  {
    formSelector: '#hapi-form',
    hapiFormID: 'adaf0cf3-aaaa-aaaa-aaaa-e180e734f588',
    redirectUrl: '/thank-you/',
  }]
);


```

### For HTML project 
```html
<!--unpkg cdn-->

<link rel="stylesheet" href="https://unpkg.com/hapiform.js@latest/hapiform.css">

<script src="https://unpkg.com/hapiform.js@latest/hapiform.js"></script>
```

```javascript

// set up one or more forms
let formConfig= [  
  {
    hapiFormID: '40552337-abcd-abcd-abcd-e4bc28e9c874', // todo: replace your real form Id
    redirectUrl:'/success/'
  },
  {
    formSelector: '#hapi-form-2',
    hapiFormID: '40552337-bbbb-bbbb-bbbb-e4bc28e9c874', // todo: replace your real form Id
    redirectUrl: '/thank-you.html',
  },
]
// use function to initial hapiform
initHapiForm(formConfig);

```

### Parameters

* hapiFormID - required - form id, like: '40552337-abcd-abcd-abcd-e4bc28e9c874'
* formSelector? - optional - selector of Form Element. default: '#hapi-form'
* redirectUrl? - optional - redirect to page, default: '/thank-you/'
* i18nLocale? - optional - i18n locale code

_parameters with `?` means it is optional parameter_

---
_Source: https://npm.io/package/hapiform.js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
