Sub Validate_onclick()
correctname="true"
correctmail="true"
correctcomment="true"
correctTel="true"
ConfirmEmail="true"
'Store mail address,name and comments into variables
mail=instr(1,FrontPage_Form1.Email.value,"@")
nam=FrontPage_Form1.Name.value
comment=FrontPage_Form1.comments.value
tel=FrontPage_Form1.Telephone.value
Email1=FrontPage_Form1.Email.value
Email2=FrontPage_Form1.EmailConfirm.value
DLfile = cbotext
'validate variables
if mail=0 or len(FrontPage_Form1.Email.value)<3 then correctmail="false"
if nam="" then correctname="false"
if len(tel)<6 then correctTel="false"
if (Email1<>Email2) and (Email1<>"") then ConfirmEmail="false"
'invalid fields??-action?
statement=""
if correctmail="true" and correctname="true" and correctcomment="true" and correctTel="true" and confirmEmail="true" then
call Frontpage_Form1.submit
alert "Thank you for your information" & Chr(10) & Chr(13) & "You will now be returned to the 'Feedback / Download' Page"
if FrontPage_form1.DownloadFile.value<>"NONE" then
but2.disabled="false"
end if
exit sub
else
end if
if correctname="false" then statement=statement & "You have left the 'Your Name' field blank." & Chr(10) & Chr(13) & Chr(10)
if correctTel="false" then statement=statement & "Your Telephone number appears incorrect" & Chr(10) & Chr(13) & Chr(10)
if correctmail="false" then statement=statement & "Your Email address appears incorrect" & Chr(10) & Chr(13) & Chr(10)
if ConfirmEmail="false" then statement=statement & "Please check your Email entries - The entries do not match" & Chr(10) & Chr(13) & Chr(10)
if correctcomment="false" then statement=statement & "You have left the 'Comments/Message' field blank." & Chr(10) & Chr(13) & Chr(10)
'statement=statement
' & "
"
msgbox "There are errors in the data - please check & re-Submit" & Chr(10) & Chr(13) & Chr(10) & Chr(13) & statement
'document.write statement
end sub