@@ -11,6 +11,7 @@ const pStyle = {margin: '1em 0'};
1111export interface IFormsPageState {
1212 birthDate : string ;
1313 radioSelected : number ;
14+ name : string ;
1415}
1516
1617export class FormsPage extends React . Component < any , IFormsPageState > {
@@ -21,7 +22,8 @@ export class FormsPage extends React.Component<any, IFormsPageState> {
2122
2223 this . state = {
2324 birthDate : '2014-04-30' ,
24- radioSelected : 1
25+ radioSelected : 1 ,
26+ name : ''
2527 }
2628
2729 this . fw7 = getFramework7 ( ) ;
@@ -34,6 +36,20 @@ export class FormsPage extends React.Component<any, IFormsPageState> {
3436 } ) ;
3537 }
3638
39+ private onBirthDateChange ( event , value ) {
40+ this . setState ( {
41+ ...this . state ,
42+ birthDate : value
43+ } ) ;
44+ }
45+
46+ private onNameChange ( event ) {
47+ this . setState ( {
48+ ...this . state ,
49+ name : event . target . value
50+ } ) ;
51+ }
52+
3753 render ( ) {
3854 return (
3955 < Page >
@@ -43,7 +59,7 @@ export class FormsPage extends React.Component<any, IFormsPageState> {
4359 < List form >
4460 < ListItem >
4561 < FormLabel > Name</ FormLabel >
46- < FormInput type = "text" placeholder = "Name" />
62+ < FormInput type = "text" placeholder = "Name" onChange = { this . onNameChange . bind ( this ) } value = { this . state . name } />
4763 </ ListItem >
4864 < ListItem >
4965 < FormLabel > Password</ FormLabel >
@@ -63,7 +79,7 @@ export class FormsPage extends React.Component<any, IFormsPageState> {
6379 </ ListItem >
6480 < ListItem >
6581 < FormLabel > Birth date</ FormLabel >
66- < FormInput type = "date" placeholder = "Birth date" value = { this . state . birthDate } />
82+ < FormInput type = "date" placeholder = "Birth date" value = { this . state . birthDate } onChange = { this . onBirthDateChange . bind ( this ) } />
6783 </ ListItem >
6884 < ListItem >
6985 < FormLabel > Date time</ FormLabel >
0 commit comments