<% Dim vTry, bValidForm Dim vName, vEmail, vPhone, vFax, vMsg Dim bName, bEmail, bPhone, bFax, bMsg vTry = Request.QueryString("Try") bValidForm = False vName = "" vEmail = "" vPhone = "" vFax = "" vMsg = "" vName = Request.Form("txtName") vEmail = Request.Form("txtEmail") vPhone = Request.Form("txtPhone") vFax = Request.Form("txtFax") vMsg = Request.Form("txtMsg") 'Check if E-mail adrress is valid. Email validation function. function isValidEmail(byval vEmail) returnVal = false if not isEmpty(vEmail) then if instr(vEmail, "@") > 0 and instr(vEmail, ".") > 0 then returnVal = true end if end if isValidEmail = returnVal end function 'Check if fields are filled with data and if e-mail is correct if vName = "" then bName = false else bName = true end if if isValidEmail(vEmail) then bEmail = true else bEmail = false end if if vPhone = "" then bPhone = true else bPhone = true end if if vFax = "" then bFax = true else bFax = true end if if vMsg = "" then bMsg = false else bMsg = true end if If bEmail = True and vTry = "Second" or vTry = "Third" Then bValidForm = True Name = Request.Form("txtName") Email = Request.Form("txtEmail") Phone = Request.Form("txtPhone") Fax = Request.Form("txtFax") Msg = Request.Form("txtMsg") Set MyCDONTSMail = CreateObject("CDONTS.NewMail") MyCDONTSMail.From = Email MyCDONTSMail.To = "jwade@drjoelwade.com" MyCDONTSMail.Subject = "DR JOEL WADE CONTACT FORM" MyCDONTSMail.Body = "DR JOEL WADE CONTACT FORM" & vbCrLf & _ "The following is a message from a visitor to http://www.DrJoelWade.com" & vbCrLf & _ "--------------------" & vbCrLf & vbCrLf & _ "Name: " & Name & vbCrLf & _ "Email: " & Email & vbCrLf & _ "Phone: " & Phone & vbCrLf & vbCrLf & _ "Fax: " & Fax & vbCrLf & vbCrLf & _ "Comments: " & Msg & " " MyCDONTSMail.Send set MyCDONTSMail=nothing If Err <> 0 Then Response.Write "Error encountered: " & Err.Description End If response.redirect "contact_sent.html" Else bValidForm = False End If If vTry = "" Then vTry = "Second" Else vTry = "Third" End If If Request.QueryString("Try") = "Second" or Request.QueryString("Try") = "" Then %> Dr. Joel Wade - www.DrJoelWade.com

Dr. Joel Wade


<% if vTry = "Third" Then %>

ATTENTION!

Please ensure that the RED marked fields are correct.

Scroll down to make corrections.


<% End If %>

DrJoelWade.com

Joel F. Wade, Ph.D.

7960-B Soquel Drive, #157
Aptos, CA USA

Phone: (831) 464-3374

FAX: (831) 464-3394

E-mail: jwade@drjoelwade.com


You may also send Joel an e-mail using the form below.
* Required Fields

<% Else If Request.QueryString ("Try") = "Third" Then 'response.redirect "contact_confirmerror.html" Response.Write "

Error encountered. Please try again.

" End If End If %>
* <% if bName = False and vTry = "Third" Then response.write "" end if %>Name:
* <% if bEmail = False and vTry = "Third" Then response.write "" end if %>Email:
Phone:
Fax:
* <% if bMsg = False and vTry = "Third" Then response.write "" end if %>Message: