Add note on how to submit a form (#6594)

This commit is contained in:
Simen Bekkhus
2016-04-28 17:42:29 +02:00
committed by Jim
parent 7351a3e873
commit 29124cc06f

View File

@@ -166,3 +166,8 @@ To make an uncontrolled component, `defaultValue` is used instead.
> Note:
>
> You can pass an array into the `value` attribute, allowing you to select multiple options in a `select` tag: `<select multiple={true} value={['B', 'C']}>`.
### Imperative operations
If you need to imperatively perform an operation, you have to obtain a [reference to the DOM node](/react/docs/more-about-refs.html#the-ref-callback-attribute).
For instance, if you want to imperatively submit a form, one approach would be to attach a `ref` to the `form` element and manually call `form.submit()`.