New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

submit-form-element

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

submit-form-element

submit a form element via xhr but as if user clicked a submit button

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

submit-form-element

given a form html element, submit it with an XHR as if you had clicked submit, but without navigating the page.

sets all the necessary headers etc so that it looks like a regular form submit.

example

var submit = require('submit-form-element').submit

submit($('form'), $('button'), function (err, response) {
  //calls back error, or xhr response
})

api

getData (form, button) => {}

return a js object representing the data that would be submitted if you were to click this button.

submit (form, button, cb)

submit the given form by clicking a particular button, and callback the response

License

MIT

FAQs

Package last updated on 21 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts