-
Notifications
You must be signed in to change notification settings - Fork 0
/
form1.html
74 lines (60 loc) · 1.52 KB
/
form1.html
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
<html>
<head>
<title></title>
</head>
<body>
<form action="formprocessor.html" method="get">
<fieldset>
<legend>Application Form </legend>
<table cellpadding="8">
<tr>
<td>Name</td>
<td><input type="text" id="txtName" size=30 value=""></td>
</tr>
<tr>
<td>Adress</td>
<td><input type="text" id="txtAdd" size=30 value=""></td>
</tr>
<tr>
<td>Gender</td>
<td><input type="radio" name="sex" value="M">Male
<input type="radio" name="sex" value="F">Female</td>
</tr>
<tr>
<td>Modules</td>
<td><input type="checkbox" name="modules" value="m1">M1
<input type="checkbox" name="modules" value="m2">M2
<input type="checkbox" name="modules" value="m3">M3
<input type="checkbox" name="modules" value="m4">M4</td>
</tr>
<tr>
<td>Stream
</td>
<td><select name="Stream">
<option id="0" value="SE">SE</option>
<option id="1" value="ISBM">ISBM</option>
<option id="2" value="CS">CS</option></td></tr>
<tr>
<td><input type="button" name="submit" value="OK" onclick="clickOk()">
<input type="reset" value="Reset form"></td></tr>
</table>
</fieldset>
</form>
<div id="display"></div>
</body>
</html>
<script type="text/javascript">
function clickOk(){
if(document.getElementById("txtName").value!=""){
if(document.getElementById("txtAdd").value!=""){
var nam=document.getElementById("txtName").value;
var add=document.getElementById("txtAdd").value;
document.getElementById("display").innerHTML='<hr>Hi '
+nam+'<br>Address: '+add; }
else
alert("please enter your Address");
}
else
alert("please enter your Name");
}
</script>