-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathadd_event.html
executable file
·87 lines (83 loc) · 2.24 KB
/
add_event.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
75
76
77
78
79
80
81
82
83
84
85
86
87
<HTML>
<HEAD>
<TITLE>Add New Event</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function verifyEvent(form){
ELABEL = document.eventform.elabel.value
ETYPE = document.eventform.etype.value
EDATE = document.eventform.edate.value
EDETAILS = document.eventform.edetails.value
ELINK = document.eventform.elink.value
if(ELABEL == null || ELABEL == "") {
alert("Label cannot be blank.");
return false;
}
else if(EDATE == null || EDATE == "") {
alert("Date cannot be blank.");
return false;
}
else if(EDETAILS == null || EDETAILS == "") {
alert("Details cannot be blank.");
return false;
}
else if(ELINK == null || ELINK == "") {
alert("Link cannot be blank.");
return false;
}
regex = /^\d{4}-\d{2}-\d{2}$/;
if(!EDATE.match(regex)) {
alert("Date does not match correct format yyyy-mm-dd.");
return false;
}
document.testform.submit();
}
</SCRIPT>
</HEAD>
<BODY>
<FORM name = "eventform" method="POST" action="/cgi-bin/add_event_cgi.py">
<TABLE border="1">
<TR>
<TH colspan="2" align="center">New Event</TH>
</TR>
<TR>
<TD>Event Name</TD>
<TD> <input type="text" name="elabel" size="25"> </TD>
</TR>
<TR>
<TD>Event Type</TD>
<TD> <select name="etype">
<option selected>Event</option>
<option>Conference</option>
<option>Hackathon</option>
<option>Project Release</option>
<option>Press</option>
<option>Team Meeting</option>
<option>Dev Meeting</option>
<option>Design Meeting</option>
<option>Test Event</option>
</select>
</TD>
</TR>
<TR>
<TD>Date</TD>
<TD> <input type="text" name="edate" size="25" value="yyyy-mm-dd"> </TD>
</TR>
<TR>
<TD colspan="2">Event Details:<BR>
<textarea name="edetails" cols="50" rows="4"> </textarea>
</TD>
</TR>
<TR>
<TD colspan="2">Event Link:<BR>
<textarea name="elink" cols="50" rows="2"> </textarea>
</TD>
</TR>
<TR>
<TD colspan="2" align="center">
<input type="submit" name = "submitbutton" value="Add Event" onClick="return verifyEvent(this.form)">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>