# remoteform

> Ajaxify forms easily

Latest version **0.0.6** (published 2019-07-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install remoteform
pnpm add remoteform
yarn add remoteform
bun add remoteform
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2019-07-09 |
| First published | 2018-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 102.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rafael Nowrotek |
| Maintainers | rexblack |
| Keywords | ajax, form |

## Links

- npm: https://www.npmjs.com/package/remoteform
- npm.io page: https://npm.io/package/remoteform

## Dependencies (3)

- [qs](https://npm.io/package/qs.md) ^6.7.0
- [get-form-data](https://npm.io/package/get-form-data.md) ^2.0.0
- [unique-selector](https://npm.io/package/unique-selector.md) ^0.3.6

## 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

- 0.0.6 (latest) — 2019-07-09
- 0.0.5 — 2019-07-08
- 0.0.4 — 2019-05-23
- 0.0.3 — 2018-03-23
- 0.0.2 — 2018-03-23

## README

# remoteform

Ajaxify forms easily

## Install

First of all install [nodejs](https://nodejs.org]) if you haven't already.

In your project directory, hit the following command order to install `remoteform`:

```cli
npm install remoteform --save
```

`remoteform` relies on `fetch` for making requests, hence you may need to install a [polyfill](https://www.npmjs.com/package/isomorphic-fetch) in addition.

## Usage

Create your html form

```html
<div id="test" class="remoteform">
  <form action="/submit.html" method="POST">
    <div class="form-group">
      <input class="form-control" name="test" value=""/>
    </div>
    <button class="btn btn-primary" type="submit">Submit</button>
  </form>
</div>
```

Import `remoteform` to your bundle and initialize with the specified selector:

```js
const remoteform = require('remoteform');

remoteform('#test');
```

If you control all forms on your site, you may want to ajaxify all forms globally by omitting the selector or passing in `form`.

### Customizing response selector

By default, `remoteform` generates a unique selector for the given element against which it matches the response. You can customize the `responseSelector` by specifying the corresponding option as follows.

```js
const remoteform = require('remoteform');

remoteform('#test', {
  responseSelector: '.my-response-selector'
});
```

## Options

| Name                    | Type    | Description                                     |
|-------------------------|---------|-------------------------------------------------|
| request                 | Object  | Options passed to fetch                         |
| responseSelector        | String  | Customize the remote content selector           |

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