Reputation: 33
This input work correct, when i just add it to the index.html
. But it doesnt work when generated by react. The nums in input form just dont changing. Why is this happening?
<input type="date" name="date" value="2003-12-16" max="2021-07-03"/>
Upvotes: 3
Views: 77
Reputation: 2495
To achieve your goal you have go with React way (Controlled Components):
<input type="date" value={this.state.value} onChange={this.handleChange} max="2021-07-03" />
Working demo: Codesandbox
To know about Uncontrolled Components
please visit: Uncontrolled Components
Upvotes: 1