Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @jsx React.DOM
- */
- var loginForm = React.createClass({
- getInitialState: function() {
- return {loggedIn : false};
- },
- login : function(event) {
- alert('logging in');
- },
- logout : function(event) {
- alert('logging out');
- },
- render: function() {
- return (
- <div>
- <form /*action={this.server+'/login.php'}*/>
- <label htmlFor="username">Username:</label>
- <input type="text" id="username" name="username" />
- <label htmlFor="password">Password:</label>
- <input type="password" id="password" name="password" />
- </form>
- </div>
- <div>
- <button onClick={this.login}> Login </button>
- <button onClick={this.logout}> Logout </button>
- </div>
- )
- }
- });
- React.renderComponent(
- <loginForm />,
- document.body
- );
- <div>
- <form /*action={this.server+'/login.php'}*/>
- <label htmlFor="username">Username:</label>
- <input type="text" id="username" name="username" />
- <label htmlFor="password">Password:</label>
- <input type="password" id="password" name="password" />
- </form>
- <div>
- <button onClick={this.login}> Login </button>
- <button onClick={this.logout}> Logout </button>
- </div>
- </div>
Add Comment
Please, Sign In to add comment