forked from gaperton/react-mvx-examples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathform.jsx
40 lines (32 loc) · 1023 Bytes
/
form.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@define class Application extends React.Component {
static state = {
name : '',
email : '',
isActive : true
};
onSubmit = e => {
}
onCancel = () => this.state.set( this.state.defaults() );
render(){
const linked = this.state.linkAll();
return (
<form onSubmit={ this.onSubmit }>
<label>
Name: <Input type="text" valueLink={ linked.name }/>
</label>
<label>
Email: <Input type="text" valueLink={ linked.email }/>
</label>
<label>
Is active: <Input type="checkbox" checkedLink={ linked.isActive }/>
</label>
<button type="submit" disabled={ !user.isValid() }>
Save
</button>
<button type="button" onClick={ this.onCancel }>
Cancel
</button>
</form>
);
}
}