Advertisement
Guest User

Untitled

a guest
Jan 11th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. var Login = React.createClass({
  3.     getInitialState: ()=> {
  4.         console.log("Login getInitialState");
  5.         return {
  6.             username: '',
  7.             password: ''
  8.         }
  9.     },
  10.     handleUsernameOnChange: function (e) {
  11.         this.setState({username: e.target.value});
  12.     }, handlePasswordOnChange: function (e) {
  13.         this.setState({password: e.target.value});
  14.     }, handleSubmit: function (e) {
  15.  
  16.     }, render: function () {
  17.         return (
  18.             <div style={{padding:100}}><center>
  19.                 <form onSubmit={this.handleSubmit} action='app.html' method="get">
  20.                     <input type="text" placeholder="Username" value={this.state.username}
  21.                            onChange={this.handleUsernameOnChange}/>
  22.                     <br/>
  23.                     <input type="password" placeholder="Password" value={this.state.password}
  24.                            onChange={this.handlePasswordOnChange}/>
  25.                     <br/>
  26.                     <input type="submit" value="Login"/>
  27.                 </form>
  28.                 </center>
  29.             </div>
  30.         );
  31.     }
  32. });
  33.  
  34. ReactDOM.render(
  35.     <Login/>,
  36.     document.getElementById('login')
  37. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement