@ruby_matt
{
email: 'mattruby@gmail.com'
}
<div class="form-group">
<label for="emailInput">Email address</label>
<input type="email" id="emailInput" />
</div>
<div className="form-group">
<label htmlFor="emailInput">Email address</label>
<input type="email" id="emailInput" />
</div>
<input
...
value={this.state.value}
onChange={this.handleChange}
/>
Validating the model on submit
<div class="form-group">
<label for="emailInput">Email address</label>
<input type="email" id="emailInput" />
</div>
{
id: 'uniqueFormId',
formGroups: {
email: {
label: {
htmlFor: 'emailInput',
children: 'Email Address'
},
control: {
type: 'email',
id: 'emailInput'
}
}
}
}
Keep the extra's like: suggestions, validation, remaining count; away from your core form functions.
https://slides.com/mattruby/practical-forms-with-react-and-mobx