-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm.js
More file actions
26 lines (24 loc) · 717 Bytes
/
Form.js
File metadata and controls
26 lines (24 loc) · 717 Bytes
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
var Form = {
// Recives user data, returns error if fields empty
"fieldIsEmpty" : function(userEntry) {
if(userEntry == "" || userEntry == null || userEntry == undefined) {
return true;
}
},
// Receives user data and tests for valid length
"validateLength" : function(userEntry) {
if(userEntry != "" && userEntry != null && userEntry != undefined) {
if(userEntry.length <= 3 || userEntry.length >= 50) {
return true;
}
}
},
// Receives user data and tests for valid zip code
"validateZip" : function(userEntry) {
if(zipCode != "" && zipCode != null && zipCode != undefined) {
if((zipCode <= 9999 || zipCode > 99999) || (isNaN(userEntry) == true)) {
return true;
}
}
}
}