Subscribe

<% 'We can change the color of the error messages here. dim ErrorColor, FormFontColor, FormBackColor ErrorColor="red" FormFontColor="navy" FormBackColor="beige" 'This section performs error checking on the form after it is submitted. 'We manually go through each field that we feel is mandatory for the purpose 'of the form and make sure that the user has chosen to either subscribe to 'the Journal and/or requested the email newsletter. Function ValidateField(sFieldvalue, sFieldtype) ValidField = true Select Case LCase(sFieldtype) Case "name" If Len(sFieldvalue) = 0 Then ValidField = False Case "email" If Len(sFieldvalue) = 0 Then ValidField = True Elseif 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 "address" If Len(sFieldvalue) = 0 Then ValidField = False Case "phone" If Len(sFieldvalue) = 0 Then ValidField = False Case "stateprov" If Len(sFieldvalue) = 0 Then ValidField = False Case "zip" If Len(sFieldvalue) = 0 Then ValidField = False Case "country" If Len(sFieldvalue) = 0 Then ValidField = False Case "city" If Len(sFieldvalue) = 0 Then ValidField = False Case "jobtitle" If Len(sFieldvalue) = 0 Then ValidField = False Case "organization" If Len(sFieldvalue) = 0 Then ValidField = False Case "organizationtype" IF sFieldvalue = "Choose one..." Then ValidField = False Case "laji" If sFieldvalue <> "maic" Then ValidField = False End Select ValidateField = ValidField End Function Sub ShowForm %>
" method="POST">

I would like to: (required)
Subscribe to the Journal
Unsubscribe from the Journal
Update the address for my Journal subscription

I am interested in: (optional)

Mine Awareness
Survey and Clearance
Victim Assistance
Asia and the Pacific
Latin America
Middle East

Africa
Europe and the Caucasus
Manual Demining
Mechanical Demining
Mine Dogs
Technology and Research
Other  " SIZE="18" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial;">

 

 

<% If Request.form("URL") <> "" Then Response.Redirect "../index.htm" End If %>

* denotes required field

*

Name

 " SIZE="29" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 <% If dictFields(LCase("name")) Then Response.Write "Name needed" Else Response.Write " " End If %>

*

Job Title

 " SIZE="29" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 <% If dictFields(LCase("jobtitle")) Then Response.Write "Title needed" Else Response.Write " " End If %>

*

Organization

 " SIZE="29" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 <% If dictFields(LCase("organization")) Then Response.Write "Organization's name needed" Else Response.Write " " End If %>

Organization Type
 
 
 
 
Organization Category (Choose one)

Policy
Awareness
Survey
R&D
Victim Assistance
Clearance
Mine Dogs
Technology
Relief and Recovery
Humanitarian Affairs
Quality Assurance
Children
Rehabilitation
Advocacy and Ban
Legal Issues
Information Management
 

Socio-Economic Development
Protective Equipment
Education
Medicine
Training
Refugees and IDPs
Reintegration
Prosthetics
Landmine Identification
Army
Demining
Demining Equipment
Fundraising and Sponsorship
Coordination
Resource Mobilization
Other
 

*

Address

 " SIZE="35" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 <% If dictFields(LCase("address")) Then Response.Write "Street address needed" Else Response.Write " " End If %>

 

Address 2

 " SIZE="35" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial;">
 

*

City

 " SIZE="24" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 <% If dictFields(LCase("city")) Then Response.Write "City needed" Else Response.Write " " End If %>

*

State / Prov

 " SIZE="24" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 <% If dictFields(LCase("stateprov")) Then Response.Write "State/Province needed" Else Response.Write " " End If %>

*

Zip

 " SIZE="24" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 <% If dictFields(LCase("zip")) Then Response.Write "Zip code needed" Else Response.Write " " End If %>

*

Country

 " SIZE="24" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 <% If dictFields(LCase("country")) Then Response.Write "Country needed" Else Response.Write " " End If %>

*

Phone

 " SIZE="24" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: <%=FormBackColor%>">
 <% If dictFields(LCase("phone")) Then Response.Write "Phone number needed" Else Response.Write " " End If %>

 

Fax

 " SIZE="24" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial;">
 

*

E-mail

 " SIZE="35" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial;"> <% If dictFields(LCase("email")) Then Response.Write "Not a valid email address." Else Response.Write " " End If %>

Message:
 

Website

 " SIZE="35" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial;">
 

*

Verification:

 " SIZE="35" style="FONT-SIZE: 11px; COLOR: <%=FormFontcolor%>; FONT-FAMILY: verdana, helvetica, arial;">
Please enter maic in the textbox above. This is used to prevent spams! Thank you!<% If dictFields(LCase("laji")) Then Response.Write "
Please enter the validation code maic.
" Else Response.Write " " End If %>

<% End Sub '------------------------------------------------------------------------------------------------------- 'This section creates the text message for the email and sends the email. 'Strings are created to hold either values of created in the form or assigned 'values after simple tests of "ON". dim subscribeJournal, subscribeCall, subscribeText, interestText, address, work, countInterests, i, dictFields dim errorCount, Field, ValidField 'This section tests for if the user wants a subscription and/or the email newsletter. 'A string is created that holds text to be sent in an email. if Request.Form("Subscribe") = "ON" then SubscribeJournal = "Send Me the Journal of Mine Action." else SubscribeJournal = "Unsubscribe me from the Journal." end if 'if Request.Form("Newsletter") = "ON" then ' SubscribeCall = SubscribeText & "Sign me up for the email newsletter." 'else ' SubscribeCall = SubscribeText & "Don't sign me up for the email newsletter." 'end if 'This section reads all of the checkboxes for interests and places their 'values in the interestText string. This also includes a test to check 'for the OTHER checkbox. If it is checked, we get the text typed in the 'OTHER text area. countInterests = Request.Form("interest").COUNT For i=1 to countInterests if countInterests = 1 then if Request.Form("interest")(i) = "Other" then interestText = Request.Form("intOther") else interestText = Request.Form("interest") end if else if i=1 then interestText = Request.Form("interest")(i) elseif Request.Form("interest")(i) = "Other" then interestText = interestText & ", Other: " & Request.Form("intOther") else interestText = interestText & ", " & Request.Form("interest")(i) end if end if Next 'This section checks the type of work that the organization mainly 'does. If the check the OTHER box, the WORK variable will be set to 'the value of the OTHER box. If request.form("work") = "true" then work = "Other: " & request.form("orgOther") Else work = request.form("work") End If '----------------------------------------------------------------------------- Set dictFields = Server.CreateObject("Scripting.Dictionary") errorCount = dictFields.Count 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 dim objNewMail Set objNewMail = CreateObject("CDO.Message") objNewMail.Subject = "Journal Subscription/Unsubscription" objNewMail.From = request.form("email") objNewMail.TO = "maic.jmu@gmail.com, maicdatabase@gmail.com" objNewMail.TextBody = subscribeJournal & vbcrlf & subscribeCall & vbcrlf & vbcrlf & "CONTACT INFORMATION: " & vbcrlf & "Name: " & request.form("name") & vbcrlf & "Title: " & request.form("jobtitle") & vbcrlf & "Organization: " & request.form("organization") & vbcrlf & "Org. Type: " & request.form("organizationtype") & vbcrlf & "Org. Work: " & work & vbcrlf & "Address 1: " & request.form("address") & vbcrlf & "Address 2: " & request.form("address2") & vbcrlf & "Address City/St/Zip: " & request.form("city") & ", " & request.form("stateprov") & ", " & request.form("zip") & vbcrlf & "Country: " & request.form("country") & vbcrlf & "Phone: " & request.form("phone") & vbcrlf & "Fax: " & request.form("fax") & vbcrlf & "E-mail: " & request.form("email") & vbcrlf & "Website: " & request.form("website") & vbcrlf & "Interests: " & interestText objNewMail.Send set objNewMail = nothing %>

Your request has been sent.

If you have any questions about the Journal of Mine Action, please feel free to email the editor at maic@jmu.edu

<% Else Response.Write "
* Please fill out the required information.

" Call ShowForm End If %>