-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormComponent.js
142 lines (140 loc) · 5.99 KB
/
FormComponent.js
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import React from 'react'
function FormComponent(props) {
return (
<main>
<form>
<table>
<tr>
<td>First Name : </td>
<td>
<input
placeholder="Enter first name"
type="text"
name="firstname"
value={props.data.firstname}
onChange={props.handelChange}
/>
</td>
</tr>
<tr>
<td>Last Name : </td>
<td>
<input
placeholder="Enter last name"
type="text"
name="lastname"
value={props.data.lastname}
onChange={props.handelChange}
/>
</td>
</tr>
<tr>
<td>Age : </td>
<td>
<input
placeholder="Enter age"
type="text"
name="age"
value={props.data.age}
onChange={props.handelChange}
/>
</td>
</tr>
<tr>
<td>Date of birth : </td>
<td>
<input
name="dob"
type="date"
value={props.data.dob}
onChange={props.handelChange}
placeholder="DD/MM/YYYY"
/>
</td>
</tr>
<tr>
<td>Gender : </td>
<td>
<input
type="radio"
name="gender"
value="Male"
checked={props.data.gender === "Male"}
onChange={props.handelChange}
/> Male
<input
type="radio"
name="gender"
value="Female"
checked={props.data.gender === "Female"}
onChange={props.handelChange}
/> Female
</td>
</tr>
<tr>
<td>Select Your Course : </td>
<td>
<select
name="course"
value={props.data.course}
onChange={props.handelChange}
>
<option value=""> Select your Course </option>
<option value="B-Tech">B-TECH</option>
<option value="BCA">BCA</option>
<option value="M-Tech">M-TECH</option>
<option value="MCA">MCA</option>
</select>
</td>
</tr>
<tr>
<td>Select Your Subject : </td>
<td>
<input
name="isReactjs"
onChange={props.handelChange}
checked={props.data.isReactjs}
type="checkbox"
/>React js
<input
name="isReactNative"
onChange={props.handelChange}
checked={props.data.isReactNative}
type="checkbox"
/>React
<input
name="isHtml"
onChange={props.handelChange}
checked={props.data.isHtml}
type="checkbox"
/>HTML
<input
name="isPython"
onChange={props.handelChange}
checked={props.data.isPython}
type="checkbox"
/>Python
</td>
</tr>
<br />
<tr>
<td></td>
<td><button>Submit</button></td>
</tr>
</table>
<h1>Check Information is write or wrong</h1>
<p>Name : {props.data.firstname} {props.data.lastname}</p>
<p>Age : {props.data.age}</p>
<p>Date of birth : {props.data.dob}</p>
<p>You are {props.data.gender}</p>
<p>Your selected course {props.data.course}</p>
<h3>Your subjects </h3>
<p>Reactjs {props.data.isReactjs ? "Yes" : "No"}</p>
<p>React Native {props.data.isReactNative ? "Yes" : "No"}</p>
<p>Html {props.data.isHtml ? "Yes" : "No"}</p>
<p>Python {props.data.isPython ? "Yes" : "No"}</p>
</form>
</main>
)
}
export default FormComponent