
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
pronto-validated-form
Advanced tools
Helpers for creating a form with validated fields.
fields
An object of field names and options {name: options, ...}
. See field options for more informationvalues
An object of field values {name: value, ...}
onSubmit(values)
A function to be called when the form is submitted (only if fields are valid)<ValidatedForm ref='form' fields={
city: {}
state: {placeholder: 'e.g. "NY" or "MA"'}
county: {optional: true}
} onSubmit={({city, state, county}) -> alert(city + ' is in ' + state) } />
name
Name of this fieldtype
One of "text", "number", "email", or "toggle", default is "text"placeholder
A placeholder, default is the un-slugified field nameerror_message
Message to show if field is invalidhidden
A boolean or function to determine if this field is hiddenoptional
A boolean or function to determine if this field is optionalThe ValidatedFormMixin
provides methods for rendering fields, keeping track of fields state, and checking that fields are valid.
getInitialState() -> {values}
required
getInitialState
that returns at least an empty values: {}
, because a React component does not have state by defaultvalues: {email: 'test@gmail.net'}
getDefaultProps() -> {fields, onSubmit}
onSubmit(values)
fields
An object of field names and options in the shape {name: options, ...}
. See field options for more informationonSubmit(values)
A function to be called when the form is submitted (only if fields are valid)values
An object of values by field namerenderField(name)
Render an individual field with the options in fields[name]
trySubmit()
A method that looks through fieldsclear()
Sets all field values to null{ValidatedFormMixin} = require 'validated-form'
FormTest = React.createClass
mixins: [ValidatedFormMixin]
getInitialState: ->
values:
name: 'test'
getDefaultProps: ->
fields:
name: {type: 'text'}
age: {type: 'number'}
email: {type: 'email'}
onSubmit: (values) ->
@setState {loading: true}
submitFormAnd =>
@clear()
@setState {loading: false}
render: ->
<div>
<form onSubmit=@trySubmit>
{@renderField 'name'}
{@renderField 'age'}
{@renderField 'email'}
<button>{if @state.loading then "Loading..." else "Submit"}</button>
</form>
</div>
FAQs
Helpers for creating a form with validated fields.
The npm package pronto-validated-form receives a total of 0 weekly downloads. As such, pronto-validated-form popularity was classified as not popular.
We found that pronto-validated-form demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.