' VB Script Document
Option Explicit


'========================= code to validate member Login =========================
dim validit

dim headit

headit = "Effizee - Information required"

Function memberlogin_OnSubmit 
validit = True

If trim(Document.memberlogin.username.Value) = "" Then 
MsgBox "Please Enter your Username (Email Address)",7, Headit
Document.memberlogin.username.focus
validit = False

elseIf InStr((trim(Document.memberlogin.username.Value)), "@") < 1 then
MsgBox "Your Username (Email Address) is Invalid! Please check for @ ",7, Headit
Document.memberlogin.username.focus
validit = False

elseIf InStr((trim(Document.memberlogin.username.Value)), ".") < 1 then
MsgBox "Your Username (Email Address) is Invalid! Please check for . ",7, Headit
Document.memberlogin.username.focus
validit = False

elseIf (Document.memberlogin.password.Value) = "" Then 
MsgBox "Please enter Your password",7, Headit
Document.memberlogin.password.focus
validit = False

end If

If validit = True Then 
memberlogin_OnSubmit = True

Else

memberlogin_OnSubmit = False

End If

End Function


'========================= code to validate member forgotten password Login =========================
dim validis

dim headis

headis = "Effizee - Information required"

Function memberlogin2_OnSubmit 
validis = True

If (Document.memberlogin2.username.Value) = "" Then 
MsgBox "Please Enter your Username (Email)",7, Headis
Document.memberlogin2.username.focus
validis = False

elseIf InStr((trim(Document.memberlogin2.username.Value)), "@") < 1 then
MsgBox "Your Username (Email Address) is Invalid! Please check for @ ",7, Headis
Document.memberlogin2.username.focus
validis = False

elseIf InStr((trim(Document.memberlogin2.username.Value)), ".") < 1 then
MsgBox "Your Username (Email Address) is Invalid! Please check for . ",7, Headis
Document.memberlogin2.username.focus
validis = False

end If

If validis = True Then 
memberlogin2_OnSubmit = True

Else

memberlogin2_OnSubmit = False

End If

End Function




'=================================================================================

dim valid
dim Heads


Heads = "Effizee.com"

Function frmPersonalInfo_OnSubmit 
valid = True

If trim((Document.frmPersonalInfo.username.Value)) = "" Then 
MsgBox "Please enter your email as username",7, Heads
Document.frmPersonalInfo.username.focus
valid = False

elseIf instr(trim(Document.frmPersonalInfo.username.Value)," ") > 0 Then 
MsgBox "There are space(s) in the username you entered. Please re-enter because spaces are not allowed.",7, Heads
Document.frmPersonalInfo.username.focus
valid = False

elseIf InStr((trim(Document.frmPersonalInfo.username.Value)), "@") < 1 then
MsgBox "Your Username (Email Address) is Invalid! Please check for @ ",7, Heads
Document.frmPersonalInfo.username.focus
valid = False

elseIf InStr((trim(Document.frmPersonalInfo.username.Value)), ".") < 1 then
MsgBox "Your Username (Email Address) is Invalid! Please check for . ",7, Heads
Document.frmPersonalInfo.username.focus
valid = False

elseIf trim((Document.frmPersonalInfo.password.Value)) = "" Then 
MsgBox "Please enter your Preferred Password",7, Heads
Document.frmPersonalInfo.password.focus
valid = False

elseIf instr(trim(Document.frmPersonalInfo.password.Value)," ") > 0 Then 
MsgBox "There are space(s) in the password you entered. Please re-enter because spaces are not allowed",7, Heads
Document.frmPersonalInfo.password.focus
valid = False

elseIf len(trim(Document.frmPersonalInfo.password.Value)) < 6 Then 
MsgBox "Password field cannot be less than 6 characters",7, Heads
Document.frmPersonalInfo.password.focus
valid = False

elseIf trim((Document.frmPersonalInfo.confirmpassword.Value)) = "" Then 
MsgBox "Please confirm your Preferred Password",7, Heads
Document.frmPersonalInfo.confirmpassword.focus
valid = False

elseIf instr(trim(Document.frmPersonalInfo.confirmpassword.Value)," ") > 0 Then 
MsgBox "There are space(s) in the confirmpassword you entered. Please re-enter because spaces are not allowed",7, Heads
Document.frmPersonalInfo.confirmpassword.focus
valid = False

elseIf lcase((trim(Document.frmPersonalInfo.password.Value))) <> lcase((trim(Document.frmPersonalInfo.confirmpassword.Value))) Then 
Document.frmPersonalInfo.password.focus
Document.frmPersonalInfo.confirmpassword.value =""
Document.frmPersonalInfo.password.value =""
MsgBox "Invalid Password Confirmation. Please re-type your password",7, Heads
valid = False

elseIf trim((Document.frmPersonalInfo.firstname.Value)) = "" Then 
MsgBox "Please enter your First Name",7, Heads
Document.frmPersonalInfo.firstname.focus
valid = False

elseIf trim((Document.frmPersonalInfo.lastname.Value)) = "" Then 
MsgBox "Please enter your Last Name",7, Heads
Document.frmPersonalInfo.lastname.focus
valid = False

elseIf trim((Document.frmPersonalInfo.nickname.Value)) = "" Then 
MsgBox "Please enter your Nickame",7, Heads
Document.frmPersonalInfo.nickname.focus
valid = False

elseIf (Document.frmPersonalInfo.agemonth.Value) = "" Then 
MsgBox "Select your month of birth",7, Heads
Document.frmPersonalInfo.agemonth.focus
valid = False

elseIf (Document.frmPersonalInfo.ageday.Value) = "" Then 
MsgBox "Select your date of birth",7, Heads
Document.frmPersonalInfo.ageday.focus
valid = False

elseIf (Document.frmPersonalInfo.ageyear.Value) = "" Then 
MsgBox "Select your year of birth",7, Heads
Document.frmPersonalInfo.ageyear.focus
valid = False


elseIf (Document.frmPersonalInfo.gender.Value) = "" Then 
MsgBox "Please Select your gender",7, Heads
Document.frmPersonalInfo.gender.focus
valid = False

elseIf (Document.frmPersonalInfo.maritalstatus.Value) = "" Then 
MsgBox "Please Select your Marital Status",7, Heads
Document.frmPersonalInfo.maritalstatus.focus
valid = False

elseIf (Document.frmPersonalInfo.stateoforigin.Value) = "" Then 
MsgBox "Please Select your State of Origin",7, Heads
Document.frmPersonalInfo.stateoforigin.focus
valid = False

elseIf (Document.frmPersonalInfo.nationality.Value) = "" Then 
MsgBox "Please Select your Nationality",7, Heads
Document.frmPersonalInfo.nationality.focus
valid = False

elseIf trim((Document.frmPersonalInfo.address.Value)) = "" Then 
MsgBox "Please enter your address",7, Heads
Document.frmPersonalInfo.address.focus
valid = False

elseIf trim((Document.frmPersonalInfo.city.Value)) = "" Then 
MsgBox "Please enter your city",7, Heads
Document.frmPersonalInfo.city.focus
valid = False

elseIf (Document.frmPersonalInfo.country.Value) = "" Then 
MsgBox "Please enter the country where you live",7, Heads
Document.frmPersonalInfo.country.focus
valid = False

elseIf (Document.frmPersonalInfo.secretquestion.Value) = "" Then 
MsgBox "Please enter Secret Question",7, Heads
Document.frmPersonalInfo.secretquestion.focus
valid = False

elseIf (Document.frmPersonalInfo.secretanswer.Value) = "" Then 
MsgBox "Please enter Secret Answer",7, Heads
Document.frmPersonalInfo.secretanswer.focus
valid = False

elseIf trim((Document.frmPersonalInfo.imagefield.Value)) = "" Then 
MsgBox "Enter the number in the box below it",7, Heads
Document.frmPersonalInfo.imagefield.focus
valid = False

elseIf trim((Document.frmPersonalInfo.imagefield.Value)) <> trim((Document.frmPersonalInfo.hiddenfield.Value)) Then 
MsgBox "Enter the number correctly in the box below it",7, Heads
Document.frmPersonalInfo.imagefield.focus
valid = False



end If

If valid = True Then 
frmPersonalInfo_OnSubmit = True

Else

frmPersonalInfo_OnSubmit = False

End If

End Function


'=================================================================================

dim valide
dim Heade


Heade = "Effizee.com"

Function frmPersonalsInfo_OnSubmit 
valide = True

'If (Document.frmPersonalsInfo.currentstatus.Value) = "" Then 
'MsgBox "Please enter Thoughts and Feelings",7, Heade
'Document.frmPersonalsInfo.currentstatus.focus
'valide = False

'elseIf len(Document.frmPersonalsInfo.currentstatus.Value) > 200 Then 
'MsgBox "Thought and Feelings cannot be more than 200 characters long",7, Heade
'Document.frmPersonalsInfo.currentstatus.focus
'valide = False

If (Document.frmPersonalsInfo.aboutme.Value) = "" Then 
MsgBox "Please enter about me",7, Heade
Document.frmPersonalsInfo.aboutme.focus
valide = False

elseIf len(Document.frmPersonalsInfo.aboutme.Value) > 300 Then 
MsgBox "About Me cannot be more than 300 Characters long",7, Heade
Document.frmPersonalsInfo.aboutme.focus
valide = False

elseIf (Document.frmPersonalsInfo.height.Value) = "" Then 
MsgBox "Please enter your height",7, Heade
Document.frmPersonalsInfo.height.focus
valide = False

elseIf (Document.frmPersonalsInfo.bodybuild.Value) = "" Then 
MsgBox "Please select your bodybuild",7, Heade
Document.frmPersonalsInfo.bodybuild.focus
valide = False

elseIf (Document.frmPersonalsInfo.skincolour.Value) = "" Then 
MsgBox "Please select your skin colour",7, Heade
Document.frmPersonalsInfo.skincolour.focus
valide = False


elseIf (Document.frmPersonalsInfo.eyecolour.Value) = "" Then 
MsgBox "Please select your eye colour",7, Heade
Document.frmPersonalsInfo.eyecolour.focus
valide = False

elseIf (Document.frmPersonalsInfo.haircolour.Value) = "" Then 
MsgBox "Please select your hair colour",7, Heade
Document.frmPersonalsInfo.haircolour.focus
valide = False

elseIf (Document.frmPersonalsInfo.hobbies.Value) = "" Then 
MsgBox "Please enter your hobbies",7, Heade
Document.frmPersonalsInfo.hobbies.focus
valide = False

elseIf len(Document.frmPersonalsInfo.hobbies.Value) > 200 Then 
MsgBox "Hobbies cannot be more than 200 Characters long",7, Heade
Document.frmPersonalsInfo.hobbies.focus
valide = False

elseIf (Document.frmPersonalsInfo.smoking.Value) = "" Then 
MsgBox "Select smoking preference",7, Heade
Document.frmPersonalsInfo.smoking.focus
valide = False

elseIf (Document.frmPersonalsInfo.ethnicity.Value) = "" Then 
MsgBox "Select your ethnicity",7, Heade
Document.frmPersonalsInfo.ethnicity.focus
valide = False


elseIf (Document.frmPersonalsInfo.searching.Value) = "" Then 
MsgBox "Please Select single status",7, Heade
Document.frmPersonalsInfo.searching.focus
valide = False

elseIf (Document.frmPersonalsInfo.relationship.Value) = "" Then 
MsgBox "Please Select type of relationship",7, Heade
Document.frmPersonalsInfo.relationship.focus
valide = False

elseIf len(Document.frmPersonalsInfo.qualitiesdesired.Value) > 200 Then 
MsgBox "Qualities desired cannot be more than 200 Characters long",7, Heade
Document.frmPersonalsInfo.qualitiesdesired.focus
valide = False

elseIf len(Document.frmPersonalsInfo.firstdate.Value) > 200 Then 
MsgBox "Idea of a first date cannot be more than 200 Characters long",7, Heade
Document.frmPersonalsInfo.firstdate.focus
valide = False

elseIf len(Document.frmPersonalsInfo.otherinfo.Value) > 300 Then 
MsgBox "Other Info cannot be more than 300 Characters long",7, Heade
Document.frmPersonalsInfo.otherinfo.focus
valide = False


end If

If valide = True Then 
frmPersonalsInfo_OnSubmit = True

Else

frmPersonalsInfo_OnSubmit = False

End If

End Function




'=================================================================================

dim validb
dim Headb


Headb = "Effizee.com"

Function frmclientInfo_OnSubmit 
validb = True

If (Document.frmclientInfo.username.Value) = "" Then 
MsgBox "Please enter your Preferred Username",7, Headb
Document.frmclientInfo.username.focus
validb = False

elseIf instr(Document.frmclientInfo.username.Value," ") > 0 Then 
MsgBox "There are space(s) in the username you entered. Please re-enter because spaces are not allowed.",7, Headb
Document.frmclientInfo.username.focus
validb = False

elseIf (Document.frmclientInfo.password.Value) = "" Then 
MsgBox "Please enter your Preferred Password",7, Headb
Document.frmclientInfo.password.focus
validb = False

elseIf instr(Document.frmclientInfo.password.Value," ") > 0 Then 
MsgBox "There are space(s) in the password you entered. Please re-enter because spaces are not allowed",7, Headb
Document.frmclientInfo.password.focus
validb = False

elseIf len(Document.frmclientInfo.password.Value) < 6 Then 
MsgBox "Password field cannot be less than 6 characters",7, Headb
Document.frmclientInfo.password.focus
validb = False

elseIf (Document.frmclientInfo.confirmpassword.Value) = "" Then 
MsgBox "Please confirm your Preferred Password",7, Headb
Document.frmclientInfo.confirmpassword.focus
validb = False

elseIf lcase((Document.frmclientInfo.password.Value)) <> lcase((Document.frmclientInfo.confirmpassword.Value)) Then 
Document.frmclientInfo.password.focus
Document.frmclientInfo.confirmpassword.value =""
Document.frmclientInfo.password.value =""
MsgBox "Invalid Password Confirmation. Please re-type your password",7, Headb
validb = False

elseIf (Document.frmclientInfo.fullname.Value) = "" Then 
MsgBox "Please enter your Full Name",7, Headb
Document.frmclientInfo.fullname.focus
validb = False

elseIf (Document.frmclientInfo.address.Value) = "" Then 
MsgBox "Please enter your address",7, Headb
Document.frmclientInfo.address.focus
validb = False

elseIf (Document.frmclientInfo.city.Value) = "" Then 
MsgBox "Please enter your city",7, Headb
Document.frmclientInfo.city.focus
validb = False

elseIf (Document.frmclientInfo.country.Value) = "" Then 
MsgBox "Please enter the country where you live",7, Headb
Document.frmclientInfo.country.focus
validb = False

elseIf (Document.frmclientInfo.phoneno.Value) = "" Then 
MsgBox "Please enter your phone no",7, Headb
Document.frmclientInfo.phoneno.focus
validb = False

elseIf (Document.frmclientInfo.email.Value) = "" Then 
MsgBox "Please enter your email",7, Headb
Document.frmclientInfo.email.focus
validb = False

elseIf InStr((Document.frmclientInfo.email.Value), "@") < 1 then
MsgBox "Your Email Address is Invalid! Please check for @ ",7, Headb
Document.frmclientInfo.email.focus
validb = False

elseIf InStr((Document.frmclientInfo.email.Value), ".") < 1 then
MsgBox "Your Email Address is Invalid! Please check for . ",7, Headb
Document.frmclientInfo.email.focus
validb = False

elseIf (Document.frmclientInfo.contactperson.Value) = "" Then 
MsgBox "Please enter your contact person",7, Headb
Document.frmclientInfo.contactperson.focus
validb = False

end If

If validb = True Then 
frmclientInfo_OnSubmit = True

Else

frmclientInfo_OnSubmit = False

End If

End Function



'=================================================================================

dim validm,flnamed
dim headm


headm = "Effizee"

Function upl_OnSubmit 
validm = True

flnamed = Document.upl.hideId.Value & ".jpg"

If (Document.upl.file1.Value) = "" Then 
MsgBox "Please browse to the location of the file ",7, headm
Document.upl.file1.focus
validm = False

end If

If validm = True Then 
upl_OnSubmit = True

Else

upl_OnSubmit = False

End If

End Function



'=================================================================================

dim validt
dim headt

headt = "effizee"

Function frmsavearticle_OnSubmit 
validt = True

If (Document.frmsavearticle.summary.Value) = "" Then 
MsgBox "Please enter photo comment",7, headt
Document.frmsavearticle.summary.focus
validt = False

elseIf (Document.frmsavearticle.hiddentitle.Value) = "" Then 
MsgBox "Please browse to the location of the photo and upload before saving.",7, headt
Document.frmsavearticle.submitsave.focus
validt = False

end If

If validt = True Then 
frmsavearticle_OnSubmit = True

Else

frmsavearticle_OnSubmit = False

End If

End Function

