J.G. Salas and Sons, Inc.

  Electrical Contractors and Engineers  

J.G. Salas

<% sYouEmail="jgsalas@jgsalasandsons.com" ' Email Subject EmailSubject="Someone has contacted you from your website" ' Heading font color FontColor="#021a4a" ' Heading Background Color HeadColor="#FFFFFF" ' Form Font Color FormFontColor="#021a4a" ' Form Background Color FormBackColor="#ffffff" 'Error Message Color ErrorColor="red" ' That's it! - you may now wish to customize the header and footer files to suit your site. ' #################################################################################### Function ValidateField(sFieldvalue, sFieldtype) ValidField = true Select Case LCase(sFieldtype) Case "name" If Len(sFieldvalue) = 0 Then ValidField = False Case "email" If Len(sFieldvalue) < 5 Then ValidField = False Else If InStr(1, sFieldvalue, "@", 1) < 2 Then ValidField = False Else If InStr(1, sFieldvalue, ".", 1) < 4 Then ValidField = False End If End If End If Case "message" If Len(sFieldvalue) = 0 Then ValidField = False Case "else" ValidField = False End Select ValidateField = ValidField End Function Sub ShowForm %>

" method="post">
* Denotes a required field.

* Your name:
 
" SIZE="55" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
<% If dictFields(LCase("name")) Then Response.Write "You need to enter your name" Else Response.Write " " End If %>
Phone Number: 
" SIZE="10" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 
Referred By: 
" SIZE="75" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 
* Your email address: 
" SIZE="75" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
<% If dictFields(LCase("email")) Then Response.Write "You need to enter a valid email address" Else Response.Write " " End If %>
* Description: 
<% If dictFields(LCase("message")) Then Response.Write " You need to enter a message" Else Response.Write " " End If %>


<% End Sub Sub Send sPunter = Request.Form("Name") sPunterage = Request.Form("Age") sPunterrefby = Request.Form("refby") sPunterphone = Request.Form("phone") sPunterEmail = Request.Form("Email") Message = Request.Form("message") If Request.Form("agree") = "true" then Mailout = "They wish to be included on the mailing list" Else Mailout ="They DO NOT wish to be included on the mailing list" End If sMessage = "This is a message from " & sPunter & vbcrlf _ & vbcrlf _ & vbcrlf _ & "Phone Number: " & sPunterage & vbcrlf _ & vbcrlf _ & "They were referred by: " & sPunterrefby & vbcrlf _ & vbcrlf _ & "Description: " & Message & vbcrlf _ & vbcrlf _ & "Their email is: " & sPunterEmail & vbcrlf _ & vbcrlf _ & Mailout & vbcrlf _ & vbcrlf Set objNewMail = CreateObject("CDONTS.NewMail") objNewMail.Send sPunterEmail, sYouEmail, EmailSubject, sMessage Set objNewMail = Nothing End Sub Set dictFields = Server.CreateObject("Scripting.Dictionary") For Each Field in Request.Form If ValidateField(Request.Form(Field), Field) = False Then dictFields.Add LCase(Field), true End If Next If Request.Form.Count <> 0 And dictFields.Count = 0 Then %> Your message has been mailed!

Thank you for your interest. Someone will contact you soon.
<% Call Send Else ShowForm End If %>

 

 

Home | Expertise | Client List | Quality and Safety | Gallery | Contact Us

Website designed by Seadeek Webdesigns