-
Notifications
You must be signed in to change notification settings - Fork 0
/
script1.js
106 lines (90 loc) · 2.85 KB
/
script1.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
function addRow()
{
var fname = document.getElementById('fname').value;
var lname = document.getElementById('lname').value;
var username = document.getElementById('username').value;
var email = document.getElementById('ema').value;
var age = document.getElementById('age').value;
var phn = document.getElementById('phn').value;
//var gender = document.getElementById('gender').value;
var gender;
if (document.getElementById('g1').checked) {
gender = document.getElementById('g1').value;
}
else if (document.getElementById('g2').checked) {
gender = document.getElementById('g2').value;
}
else if (document.getElementById('g3').checked) {
gender = document.getElementById('g3').value;
}
var merch;
merch = document.getElementById("merc").value;
var dt = new Date();
var utcDate = dt.toUTCString();
//Print results
//console.log(utcDate);
var myData = [];
myData.push(fname, lname, username, email, age, phn, gender, merch, utcDate);
var table = document.getElementsByTagName('table')[0];
var newRow = table.insertRow(table.rows.length);
var cel1 = newRow.insertCell(0);
var cel2 = newRow.insertCell(1);
var cel3 = newRow.insertCell(2);
var cel4 = newRow.insertCell(3);
var cel5 = newRow.insertCell(4);
var cel6 = newRow.insertCell(5);
var cel7 = newRow.insertCell(6);
var cel8 = newRow.insertCell(7);
var cel9 = newRow.insertCell(8);
cel1.innerHTML = myData[0];
cel2.innerHTML = myData[1];
cel3.innerHTML = myData[2];
cel4.innerHTML = myData[3];
cel5.innerHTML = myData[4];
cel6.innerHTML = myData[5];
cel7.innerHTML = myData[6];
cel8.innerHTML = myData[7];
cel9.innerHTML = myData[8];
var form = document.getElementById("myForm");
function handleForm(event) { event.preventDefault(); }
form.addEventListener('submit', handleForm);
}
function change(id) {
var e = document.getElementById(id);
if (id == "regi") {
var a = document.getElementById('first');
var b = document.getElementById('tab');
if(e.style.display == 'block'){
//e.style.display = 'none';
}
else {
e.style.display = 'block';
a.style.display = 'none';
b.style.display = 'none';
}
}
else if (id == "tab") {
var a = document.getElementById('first');
var b = document.getElementById('regi');
if (e.style.display == 'block') {
//e.style.display = 'none';
}
else {
e.style.display = 'block';
a.style.display = 'none';
b.style.display = 'none';
}
}
else {
var a = document.getElementById('regi');
var b = document.getElementById('tab');
if (e.style.display == 'block') {
//e.style.display = 'none';
}
else {
e.style.display = 'block';
a.style.display = 'none';
b.style.display = 'none';
}
}
}