react-bootstrap-validation
react-bootstrap-validation copied to clipboard
Deep binding
Hi,
I was wondering if there is a way to create forms and bind inputs on complex objects.
For example let's take a complex user object :
{
name: String,
email: String,
birthdate: {
day: String,
month: String,
year: String
}
}
My form would look like this :
<Form>
<ValidatedInput type="text" name="name" validate="required" />
<ValidatedInput type="email" name="email" validate="required,isEmail" />
<ValidatedInput name="birthdate.day" type="select" validate="required">
<option>Day</option>
...
</ValidatedInput>
...
</Form>
However, the birthdate day input creates a"birthdate.day" key instead of an object.
Do you have an idea to do this ?
Thanks!
Could be done modifying Form to pass values through https://www.npmjs.com/package/dot-object