<%@ 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 & "

" End If %> How Would You Feel? <% doMenu %>


Elijah McCoy
  Lewis Latimer
  Jan Ernst Matzeliger
  Granville T. Woods
  George Washington Carver
  Madam C. J. Walker
  Garrett Morgan
  Otis Boykin
  Dr. Patricia E. Bath
  Lonnie G. Johnson
How Would You Feel?

Top Ten Home

How Would You Feel?

Imagine yourself in the shoes of these inventors. Think about being in a situation where you are the first person to break into a job where no one else like you has ever worked. Imagine how hard you would have to work to prove yourself. Type your ideas into this form and submit your work.

<% 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 %>

color="red">Put Your Title Here: <% Else %> >Put Your Title Here: <% End if %>

color= "red">How Would You Feel? <% Else %> >How Would You Feel? <% End if %>


color=red>Your First Name: <% Else %> >Your First Name: <% End If %>

color=red>Your Last Initial: <% Else %> >Your Last Initial: <% End If %>

color=red>Your Age: <% Else %> >Your Age: <% End If %>

<% If blnYourStateErr then Response.Write " Your State/Country:" Else Response.Write "Your State/Country:" End If %>
Kids: Ask your parents or teachers for approval before you submit anything to us, and read our Privacy Policy Statement.

  

Terms of Submission

Before being published, your submission will be reviewed. It will be checked to see that it does not contain any inappropriate language. By sending us your work, you are giving Scholastic permission to edit, promote, and put it up on Scholastic.com. However, because lots of students send us work, we won't be able to publish all of the work that we receive. Also, it is really important to send us only work that you made from scratch and not any work that you copied from somewhere else. Thank you.

 


<% case adSuccessMsgView: %>

THANK YOU!

Thank you for your submission.

Please check back in a few days to see if your submission has been published.

<% Case adPreView: %>

 
<% = strHTitle %>
By <% = strHFirstname %> <% If strHLastInitial <> "" Then Response.Write " " & strHLastInitial & "." End If %>
Age <% = Trim(FormatTextHTML(request("Age")))%> <% If FormatTextHTML(request("State")) <> "Other" Then Response.Write ", " & FormatTextHTML(request("State")) End If %>


<% = strHDescription %>

 
<% Dim item For Each item In Request.Form If item <> "FormAction" And item <> "ViewMode" Then Response.Write "" & vbCrLf End If Next %>
 

Terms of Submission

Kids: Ask your parents or teachers for approval before you submit anything to us, and read our Privacy Policy Statement.

Before being published, your submission will be reviewed. It will be checked to see that it does not contain any inappropriate language. By sending us your work, you are giving Scholastic permission to edit, promote, and put it up on Scholastic.com. However, because lots of students send us work, we won't be able to publish all of the work that we receive. Also, it is really important to send us only work that you made from scratch and not any work that you copied from somewhere else. Thank you.

 

<% End Select %>

<% doFooter %>