This repository was archived by the owner on Jul 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathregister.js
More file actions
68 lines (56 loc) · 2 KB
/
register.js
File metadata and controls
68 lines (56 loc) · 2 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import React from "react";
class Register extends React.Component {
constructor(props) {
super(props);
this.state = {
fullName: "",
registerEmail: "",
registerPass: ""
};
this.initBind();
}
initBind() {
this.getFullName = this.getFullName.bind(this);
this.getPasswordInput = this.getPasswordInput.bind(this);
this.getEmailInput = this.getEmailInput.bind(this);
}
getFullName(event) {
let fullName = event.target.value;
this.setState({
fullName
});
console.log(this.state.fullName);
}
getPasswordInput(event) {
let registerPass = event.target.value;
this.setState({
registerPass
});
}
getEmailInput(event) {
let registerEmail = event.target.value;
this.setState({
registerEmail
});
}
render() {
return (
<div>
<label htmlFor="fullName"><b>Name</b></label>
<br />
<input type="text" id="fullName" onChange={this.getFullName} value={this.state.fullName} placeholder="Full Name" style={{marginBottom: "5px", width: "100%"}} />
<br />
<label htmlFor="registerEmail"><b>Email</b></label>
<br />
<input type="email" id="registerEmail" onChange={this.getEmailInput} placeholder="Email Address" style={{marginBottom: "5px", width: "100%"}} />
<br />
<label htmlFor="registerPass"><b>Password</b></label>
<br />
<input type="password" id="registerPass" onChange={this.getPasswordInput} placeholder="Min 6 characters" style={{marginBottom: "15px", width: "100%"}} />
<br />
<input type="button" id="registerButton" value="Register" style={{marginLeft: "83%", borderRadius: "5px", width: "80px"}} />
</div>
);
}
}
export default Register;