-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueue.js
33 lines (30 loc) · 874 Bytes
/
queue.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
// Validate an individual Accept/Reject form for the queue
function validateForm(index)
{
var message = $('message'+index);
var accept = $('accept'+index);
var reject = $('reject'+index);
// We need all three of these to continue. If we can not get them, just
// return true to let the form continue without prompting. This is better
// than preventing a buggy/old browser from using the system.
if (!message || !accept || !reject)
return true;
// Accepted
if (accept.checked)
return true;
// Rejected
else if (reject.checked)
{
// Message wasn't set, which is required for rejecting images
if (message.value.length == 0)
{
alert("You need to write a message to the user when rejecting an image.");
return false;
}
}
else
{
alert("You must choose either Accept or Reject.");
return false;
}
}