
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.
mui-form-validator
Advanced tools
npm install --save mui-form-validator
Some rules can accept extra parameter, example:
<MuiValidator
{..someProps}
inputProps={{required: true}}/>
/*
* Created by Gihan
*/
import React, { Component } from "react";
/* Material UI Components */
import { MuiForm, MuiValidator } from "mui-form-validator";
class AddMember extends Component {
constructor(props) {
super(props);
this.state = {
loading : true,
formData: {
fname : "",
email : "",
},
fields : []
};
this.handleSubmit = this.handleSubmit.bind(this);
this.handleChange = this.handleChange.bind(this);
this.register = this.register.bind(this);
}
handleSubmit = (e) => {
//Your submit handler
//form data can get from state.fromData. you can change it as your own in handle change funcion
};
handleChange = (e) => {
//setting form data to state.you can change it as your own.
let formData = this.state.formData;
formData[e.target.name] = e.target.value;
this.setState({formData});
};
//register fields to validate (please add this function for register your form fields.this is required)
register(field) {
let s = this.state.fields;
s.push(field);
this.setState({fields: s});
};
render() {
return (
<MuiForm
onSubmit={this.handleSubmit}
noValidate>
<MuiValidator placeholder={"First Name"} name={"fname"} type={"text"}
onChange={this.handleChange} value={this.state.formData.fname}
inputProps={{required: true}} onComponentMounted={this.register}
fullWidth={true}/>
<MuiValidator placeholder={"Email"} name={"email"}
onChange={this.handleChange} value={this.state.formData.email}
inputProps={{required: true}} onComponentMounted={this.register}
fullWidth={true}/>
<Button type={"submit"} variant={"raised"} color={"primary"}>Submit</Button>
</MuiForm>
);
}
}
FAQs
easy way to handle your forms with validation
The npm package mui-form-validator receives a total of 1 weekly downloads. As such, mui-form-validator popularity was classified as not popular.
We found that mui-form-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.