I am new to reactjs and javascript. I am trying to create a very basic login and registration form. When a client enters email and password, and clicks 'register', the form should take him to next form- which is Contact Information form. But my page refreshes and brings me back to original screen instead of contact information screen. Here's the code for login and contact info-
import React from 'react';
import {render} from 'react-dom';
import { ContactInfo } from './ContactInfo.jsx'
var App = React.createClass ({
handleClick: function(){
<ContactInfo new="new"/>;
},
render: function() {
return (<div>
<h1>Login</h1>
<form>
Email: <input type="text" name="email" method="get" />
<br />
<br />
Password: <input type="password" name="pwd" />
<br />
<a href=""><i>forgot password?</i></a>
<br /><br />
<button>Login</button>
<button onClick={this.handleClick}>Register</button>
</form>
</div>);
}
});
render(<App />, document.getElementById('app'));
and Contact Info:
import React from 'react';
var ContactInfo = React.createClass({
render: function(){
return(
<div>
<form>
Name: <input type="text"/>
<br />
<br />
Phone: <input type="text"/>
<br />
Address:
Street <input type = "text" />
<br />
City <input type = "text" />
<br />
State <input type = "text" /><p> </p>zip <input type = "text" />
<br />
Country <input type = "text" />
<br /><br />
<button>Continue</button>
</form>
</div>);
}
});
export default ContactInfo;