%@ Language = "VBScript"%>
<%
Response.Buffer = True
%>
<%
const adNew = 1
const adLive = 2
const adRejected = 3
const adHold = 4
const adAll = 5
const adEditView = 1
const adSuccessMsgView = 2
const adPreView = 3
Dim X
Dim blnTBFnameErr, blnTBWhyErr, blnYourFnameErr, blnYourLInitialErr, blnYourAgeErr, blnYourStateErr
Dim blnoptionErr, javaasp, aspSJScript, aspSHeader, aspsFooter
%>
<%
'convert form entry to html, catch special characters & preserve correct format
dim strHTitle
strHTitle = FormatTextHTML(request("Writing_Title"))
strHTitle = FormatTextHTML(strHTitle)
dim strHDescription
strHDescription = FormatTextHTML(request("Writing_ArticleText"))
strHDescription = FormatTextHTML(strHDescription)
dim strHFirstname
strHFirstname = FormatTextHTML(request("Firstname"))
strHFirstname = FormatTextHTML(strHFirstname)
dim strHLastInitial
strHLastInitial = FormatTextHTML(request("LastInitial"))
strHLastInitial = FormatTextHTML(strHLastInitial)
'convert form entry to text, catch special characters & preserve correct format
dim strTTitle
strTTitle = FormatTextHTML(request("Writing_Title"))
strTTitle = FormatHTMLText(strTTitle)
dim strTDescription
strTDescription = FormatTextHTML(request("Writing_ArticleText"))
strTDescription = FormatHTMLText(strTDescription)
dim strTFirstname
strTFirstname = FormatTextHTML(request("Firstname"))
strTFirstname = FormatHTMLText(strTFirstname)
dim strTLastInitial
strTLastInitial = FormatTextHTML(request("LastInitial"))
strTLastInitial = FormatHTMLText(strTLastInitial)
Dim aStates, aAges, blnFormOK, blnValidateForm
aStates = Array( "Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado", _
"Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho", _
"Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", _
"Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota", _
"Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire", _
"New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", _
"Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", _
"South Dakota", "Tennessee", "Texas", "Utah", "Vermont", "Virginia", "Washington", _
"West Virginia", "Wisconsin", "Wyoming", "------------", _
"Afghanistan", "Albania ", "Algeria ", "Andorra ", "Angola", "Antigua/Barbuda", "Argentina", _
"Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", _
"Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia/Herzegovina", "Botswana", _
"Brazil", "Brunei", "Bulgaria", "Burkina faso", "Burundi", "Cambodia", "Cameroon", "Canada", _
"Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo Republic", _
"Costa Rica", "Cote d Ivore", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", _
"Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", _
"Estonia", "Ethiopia", "Fiji", "Finland", "France", "French Guiana", "Gabon", "Gambia", "Georgia", _
"Germany", "Ghana", "Greece", "Grenada", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", _
"Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", _
"Italy", "Jamaica", "Japan", "Jordan", "Kazakstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan", "Laos", _
"Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", _
"Macedonia", "Madagascar", "Malawi", "Malaysia", "Mali", "Malta", "Marshall Islands", "Mauritania", _
"Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", _
"Namibia", "Nepal", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "North Korea", _
"Norway", "Oman", "Pakistan", "Palau", "Panama", "Papau New Guinea", "Paraguay", "Peru", "Philippines", _
"Poland", "Portugal", "Puerto Rico", "Qatar", "Romania", "Russia", "Rwanda", "Samoa", "Sao Tome and Principe", _
"Saudi Arabia", "Senegal", "Sierra-Leone", "Slovakia","Slovenia", "Solomon Islands", "Somalia", "South Africa", _
"South Korea", "Spain", "Sri Lanka", "St Kitts/Nevis", "St Lucia", "St Vincent/The Grenadines", "Sudan", _
"Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Tahiti", "Taiwan", "Tajikistan", "Tanzania", _
"Thailand", "The Netherlands", "Togo", "Tonga", "Trinidad/Tobago", "Tunisia", "Turkey", "Turkmenistan", _
"Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "Uruguay", "Uzbekistan", "Vanuatu", _
"Venezuela", "Vietnam", "Virgin Islands", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe" )
Dim oldViewMode, curViewMode
oldViewMode = FormatTextHTML(request.Form("ViewMode"))
'********** Check Mode ***********
select Case FormatTextHTML(request("FormAction"))
Case "Preview":
curViewMode = adPreView
blnValidateForm = True
Case "Submit", "Edit":
If oldViewMode = adPreView Then ' if form has been already validated
blnValidateForm = False
Else
blnValidateForm = True
End If
curViewMode = adEditView
Case Else:
curViewMode = adEditView
blnValidateForm = False
End select
'********** Validating Form ***********
If blnValidateForm <> False then
Dim strErrorFields
strErrorFields = ""
If FormatTextHTML(request("Writing_Title")) = "" then
strErrorFields = "Title"
blnTBFnameErr = True ' -->Sanjay
End If
If FormatTextHTML(request("Writing_ArticleText")) = "" then
If strErrorFields <> "" then strErrorFields = strErrorFields & ", "
strErrorFields = strErrorFields & "Article Text"
blnTBWhyErr = True
End If
If FormatTextHTML(request("Firstname")) = "" then
If strErrorFields <> "" then strErrorFields = strErrorFields & ", "
strErrorFields = strErrorFields & "First Name"
blnYourFnameErr = True
End If
'Making Last Initial Field Mandatory ---->Sanjay
If FormatTextHTML(request("LastInitial")) = "" then
If strErrorFields <> "" then strErrorFields = strErrorFields & ", "
strErrorFields = strErrorFields & "Last Initial"
blnYourLInitialErr = True
End If
'Code addition ended
If FormatTextHTML(request("Age")) = "0" then
If strErrorFields <> "" then strErrorFields = strErrorFields & ", "
strErrorFields = strErrorFields & "Age"
blnYourAgeErr = True
End If
If FormatTextHTML(request("State")) = "0" Or FormatTextHTML(request("State")) = "------------" then
If strErrorFields <> "" then strErrorFields = strErrorFields & ", "
strErrorFields = strErrorFields & "State"
blnYourStateErr = True
End If
If strErrorFields = "" then ' Any Error?
blnFormOK = True ' No Error
Else
blnFormOK = False ' At least one Error
End If
End If
dim strVar
strVar = FormatTextHTML(request("FormAction"))
'********** Save/Update Record ***********
If blnFormOK AND strVar = "Submit" Then
curViewMode = adSuccessMsgView
InsertSubmission
'else
'Response.Write "blnFormOK: " & blnFormOK & "
"
'Response.Write "adSuccessMsgView:" & adSuccessMsgView & "
"
'Response.Write "FormAction: " & strVar & "
"
'Response.Write "curViewMode: " & curViewMode & "
"
'Response.Write "error: " & err.description
'response.write "Error Number= #" & err.number & "
"
'response.write "Error Desc.= " & err.description & "
"
'response.write "Help Context= " & err.HelpContext & "
"
'response.write "Help File Path=" & err.helpfile & "
"
'response.write "Error Source= " & err.source & "
![]() |
|||||||||||||||||||||||||||||||
|
<%
select Case curViewMode
Case adEditView: ' Edit/Error Fix
If strErrorFields <> "" then ' Error Found?
' YES, there is some error
Response.Write " Oops! " Response.Write " You need to correct the following problem(s) before we can accept your submission: " Response.Write "You have left the following field(s) blank: " & strErrorFields & ". " End If %>How Would You Feel?Imagine yourself in Melba's shoes. Think about being in a situation in which you are fighting to change the way things have always been. Imagine being the first to do something very hard - so hard most people wouldn't even try. Type your ideas into this form and submit your work.
|
||||||||||||||||||||||||||||||