<% formFields = Array("name", "friendsEmail") errorMessage = "" // set up a dictionary for form info Set formInfo = CreateObject("Scripting.Dictionary") // set defaults if just entering the form For Each fieldName In formFields fieldValue = "" formInfo.Add fieldName, fieldValue Next For Each fieldName In formFields fieldValue = CStr(Request.QueryString(fieldName)) formInfo.Item(fieldName) = fieldValue Next // validate required fields errorMessage = ternaryOperator((formInfo.Item("name") = ""), errorMessage & "Please provide your name.
", errorMessage) errorMessage = ternaryOperator((formInfo.Item("friendsEmail") = ""), errorMessage & "Please provide your friend's email.
", errorMessage) If errorMessage = "" Then message = "Hi! Your friend, " & formInfo.Item("name") & ", wanted to share with you a " & _ "Web site called The Salary Odometer. Located at http://www.jjjwebdevelopment.com/306sites/salaryo/ this " & _ "site lets you watch your money roll in as you make it. It's a fun way to see just how much your time is " & _ "worth! " & VbCrLf & VbCrLf & _ "You can see how much you just got paid for that 15 minute ""power nap"" or find out how little " & _ "the company paid you for that implementation that will save them thousands!" & VbCrLf & VbCrLf & _ "Check it out at http://www.jjjwebdevelopment.com/306sites/salaryo/ and don't forget to thank " & _ "your friend " & formInfo.Item("name") & " later!" & VbCrLf Call sendEmail(formInfo.Item("friendsEmail"), formInfo.Item("friendsEmail"), formInfo.Item("name"), "salaryo@jjjwebdevelopment.com", "Check out The Salary Odometer", message) End If %> Send The Salary Odometer to a Friend
Send The Salary Odometer to a Friend

<% If errorMessage <> "" Then %> Oops! We can't quite send your message yet:
<%= errorMessage %>


Please close this window and try again. <% Else %> You have successfully sent your message to <%= safeHTMLEncode(formInfo.Item("friendsEmail")) %>. Thanks for sharing The Salary Odometer with others!

close this window <% End If %>