' VB Script Document
Option Explicit

'=================================================================================
	'Contact Us validation code
'=================================================================================

dim validcontact
dim headercontact


headercontact = "Duroogboye - Error on Contact Us Form!"



Function Contacts_OnSubmit 
validcontact = True

If (Document.Contacts.name.Value) = ""  Then 
MsgBox "Please enter your Name. ",7, headercontact
Document.Contacts.name.focus
validcontact = False

elseIf Isnumeric(Document.Contacts.name.Value)  Then 
MsgBox "Please enter your Real Name not Numbers. ",7, headercontact
Document.Contacts.name.focus
validcontact = False


elseIf (Document.Contacts.email.Value) = ""  Then 
MsgBox "Please fill in your email address! ",7, headercontact
Document.Contacts.email.focus
validcontact = False

elseIf Len(Document.Contacts.email.Value) < 5 OR NOT Instr(1, (Document.Contacts.email.Value), " ") = 0 OR InStr(1, (Document.Contacts.email.Value), "@", 1) < 2 OR InStrRev((Document.Contacts.email.Value), ".") < InStr(1, (Document.Contacts.email.Value), "@", 1) then
MsgBox "Your e-mail address is Invalid! Please check for @ or . ",7, headercontact
Document.Contacts.email.focus
validcontact = False

elseIf (Document.Contacts.comment.Value) = ""  Then 
MsgBox "Please drop your comments or suggestions! ",7, headercontact
Document.Contacts.comment.focus
validcontact = False


end If

If validcontact = True Then 
Contacts_OnSubmit = True

Else

Contacts_OnSubmit = False

End If

End Function

'=================================================================================
	'Job Application validation code
'=================================================================================

dim valids
dim headers


headers = "Duroogboye - Error on Contact Us Form!"



Function Resume_OnSubmit 
valids = True

If (Document.Resume.fullname.Value) = ""  Then 
MsgBox "Please enter your Fullname. ",7, headers
Document.Resume.fullname.focus
valids = False

elseIf Isnumeric(Document.Resume.fullname.Value)  Then 
MsgBox "Please enter your Real Fullname not Numbers. ",7, headers
Document.Resume.fullname.focus
valids = False

elseIf (Document.Resume.gender.Value) = ""  Then 
MsgBox "Please enter your gender. ",7, headers
Document.Resume.gender.focus
valids = False

elseIf (Document.Resume.dateofbirth.Value) = "" Then 
MsgBox "Please enter your date of Birth. ",7, headers
Document.Resume.dateofbirth.focus
valids = False

elseIf (Document.Resume.address.Value) = "" Then 
MsgBox "Please enter your Address. ",7, headers
Document.Resume.address.focus
valids = False

elseIf (Document.Resume.email.Value) = ""  Then 
MsgBox "Please fill in your email address! ",7, headers
Document.Resume.email.focus
valids = False

elseIf Len(Document.Resume.email.Value) < 5 OR NOT Instr(1, (Document.Resume.email.Value), " ") = 0 OR InStr(1, (Document.Resume.email.Value), "@", 1) < 2 OR InStrRev((Document.Resume.email.Value), ".") < InStr(1, (Document.Resume.email.Value), "@", 1) then
MsgBox "Your e-mail address is Invalid! Please check for @ or . ",7, headers
Document.Resume.email.focus
valids = False

elseIf (Document.Resume.school1.Value) = "" or (Document.Resume.qualification1.Value) = "" or (Document.Resume.dateobtained1.Value) = "" Then 
MsgBox "Please fill in your first educational qualification ",7, headers
Document.Resume.school1.focus
valids = False

elseIf (Document.Resume.school2.Value) = "" or (Document.Resume.qualification2.Value) = "" or (Document.Resume.dateobtained2.Value) = "" Then 
MsgBox "Please fill in your second educational qualification ",7, headers
Document.Resume.school2.focus
valids = False

end If

If valids = True Then 
Resume_OnSubmit = True

Else

Resume_OnSubmit = False

End If

End Function
'=================================================================================
