Solved

Mandatory field in ASP -- Provinces.

Posted on 2004-09-22
17
373 Views
Last Modified: 2012-08-14
Hello,

How i'm able to mark the province field as a mandatory field in my online survey.  Would you pls advice. thank you.

This is my code... Pls see my comments below i think i'm wrong in the check imput area... Please correct me. thank you for your time.


dim objMail, msgto, strRecommend, strProvince, arrProvinces(14)

set objMail=server.CreateObject("CDONTS.NewMail")
objMail.To="elie_azzi@caf-fca.org"                             'set TO address
objMail.from="elie_azzi@caf-fca.org"                          'set FROM address
objMail.value("reply-to") ="elie_azzi@caf-fca.org"        'set reply to address
objMail.subject="Apprentice Trades - Online Survey"    'set the subject line
   
                   arrProvinces(0) = " "
         arrProvinces(1) = " Alberta"
         arrProvinces(2) = " British Columbia"
         arrProvinces(3) = " Manitoba"
         arrProvinces(4) = " New Brunswick"
         arrProvinces(5) = " Newfoundland"
         arrProvinces(6) = " Nova Scotia"
         arrProvinces(7) = " Nunavut"
         arrProvinces(8) = " Northwest Territories"
         arrProvinces(9) = " Ontario"
         arrProvinces(10) = " Prince Edward Island"
         arrProvinces(11) = " Quebec"
         arrProvinces(12) = " Saskatchewan"
         arrProvinces(13) = " Yukon"

                   strProvince = arrProvinces(request.form("selQ1"))
   
           
         If Request.Form("radQ15") ="1" then
               strRecommend = "Yes"
         elseif Request.Form("radQ15") ="2" then
               strRecommend = "Yes"
         else
                strRecommend = "Maybe"
         end if

                    
objMail.body="Apprentice Trades - Online Survey" & VBCrLf & VBCrLf & "My Province/Territory in which I reside: " & strProvince & VBCrLf & VBCrLf &  "Would you recommend this website to others: " & strRecommend  & VBCrLf & VBCrLf & "Comments or suggestions to improve the website: " & VBCrLf & Request.Form("txtQ16") & VBCrLf
 
' I NEED HELP HERE PLEASE .................
 ' Before I send the message or the form, I need to make sure that the province field is selected.
                    
 ' Check input ... This is not correct... but you see what i means. please advice.

               strProvince = ""
               if Trim(rq("selQ1")) = "" then strMsg = strMsg & "<li>" & svlang("Province is missing") & "<br>"
               else
         ' Send email
            
               objMail.send                           'send the message
               set objMail=nothing                'destroy the component
               'Response.Write "done"

Thank you for your time.
0
Comment
Question by:elieazzi
  • 10
  • 6
17 Comments
 
LVL 23

Expert Comment

by:apresto
Comment Utility
You could use some java script to validate the fields, so basically when the user submits the form and one or more (how ever u specify) fields do not have any or relevant info it will give a message informing them of the error and ask them to fill in the field:

To get such a script visit

www.javascriptworld.com

But to go straight to this kind of script go to:

http://www.javascriptworld.com/scripts/index.html    >>>>> Go to chapter 8 - Form handling

This site has a nmber of form handling scripts, im sure you will find it useful
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
Yes put this at the top of your page:

<SCRIPT LANGUAGE="JavaScript">
<!--
function hasSelection(strFieldName,strMessage){
      var objFormField = document.forms[0].elements[strFieldName];
      if (objFormField.selectedIndex == 0){
            alert("The " + strMessage + " cannot be blank.");
            objFormField.focus() ;
            return false ;
      }
      return true;
}
//-->


and then add this to your form:

onSubmit = "return hasSelection('selQ1')"

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
Oops, that should be:

onSubmit = "return hasSelection('selQ1','Please select a Province!')"
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
So your form tag will look like this:

<form name="form1" action="default.asp" method="post" onSubmit = "return hasSelection('selQ1','Please select a Province!')">

This code goes in the head of your form:

<SCRIPT LANGUAGE="JavaScript">
<!--
function hasSelection(strFieldName,strMessage){
     var objFormField = document.forms[0].elements[strFieldName];
     if (objFormField.selectedIndex == 0){
          alert("The " + strMessage + " cannot be blank.");
          objFormField.focus() ;
          return false ;
     }
     return true;
}
//-->
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
If you post the most recent version of your page, I'll integrate the above code for you.

FtB
0
 

Author Comment

by:elieazzi
Comment Utility
Okay Here is what I've done I'm not sure if it's correct.   Would you like me to post it?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
So, like this, then?

<%@ Language=VBScript %>
<%Option Explicit%>
<!--#include virtual="/globalincludes/global.routines.inc"-->
<!--#include virtual="/globalincludes/database.inc"-->
<!-- #include virtual="/en/includes/htmlhead.inc" -->

 
<%
'==============================================================================
'              AppName = CAF-FCA Canadian Apprenticeship Forum
'==============================================================================
'
'             VSS Version: $Revision: 5 $
'        Last Modified by: $Author: Ttf $
'            Last Checkin: $Date: 2/10/04 3:43p $
'  Last Modification Time: $Modtime: 2/10/04 3:32p $
'                FileName: $Workfile: default.asp $
'
'             Description: Popup page presents UAT survey.
'
'==============================================================================
' DO NOT EDIT VERSION INFO ABOVE - Automatically updated by SourceSafe at Check-in

'------------------------------------------------------------------------------
' BEGIN Server-side functions
' -----------------------------------------------------------------------------
sub Main()
    CreateGlobalObjects
   
    Dim strAction, strConfirm
    strAction = rq("userAction")
    strConfirm = rq("confirm")
   
    select case strAction
        case "SAVESURVEY":
           
               call SaveSurveyResponse()
               dim objMail, msgto, strRecommend, strProvince, arrProvinces(14)
                        set objMail=server.CreateObject("CDONTS.NewMail")
                   objMail.To="elie_azzi@caf-fca.org"                    'set TO address
                     objMail.from="elie_azzi@caf-fca.org"                  'set FROM address
                     objMail.value("reply-to") ="elie_azzi@caf-fca.org"    'set reply to address
                     objMail.subject="Apprentice Trades - Online Survey"   'set the subject line
                    'objMail.body="Question 16as you wish" & VBCrLf & Request.Form("txtQ16") & VBCrLf & VBCrLf
   
               arrProvinces(0) = " "
                     arrProvinces(1) = " Alberta"
                     arrProvinces(2) = " British Columbia"
                     arrProvinces(3) = " Manitoba"
                     arrProvinces(4) = " New Brunswick"
                     arrProvinces(5) = " Newfoundland"
                     arrProvinces(6) = " Nova Scotia"
                     arrProvinces(7) = " Nunavut"
                     arrProvinces(8) = " Northwest Territories"
                     arrProvinces(9) = " Ontario"
                     arrProvinces(10) = " Prince Edward Island"
                     arrProvinces(11) = " Quebec"
                     arrProvinces(12) = " Saskatchewan"
                     arrProvinces(13) = " Yukon"

                     strProvince = arrProvinces(request.form("selQ1"))
   
           
                     If Request.Form("radQ15") ="1" then
                       strRecommend = "Yes"
                     elseif Request.Form("radQ15") ="2" then
                       strRecommend = "Yes"
                     else
                     strRecommend = "Maybe"
                     end if

                    
              objMail.body="Apprentice Trades - Online Survey" & VBCrLf & VBCrLf & "My Province/Territory in which I reside: " & strProvince & VBCrLf & VBCrLf &  "Would you recommend this website to others: " & strRecommend  & VBCrLf & VBCrLf & "Comments or suggestions to improve the website: " & VBCrLf & Request.Form("txtQ16") & VBCrLf
 
 
               ' Before I send the message or the form, I need to make sure that the province field
                     ' is selected.
                    
                    ' Check input

              ' strProvince = ""
               'if Trim(rq("selQ1")) = "" then strMsg = strMsg & "<li>" & svlang("Province is missing") & "<br>"
                    'else
                 ' Send email
            
               objMail.send                       'send the message
               set objMail=nothing                'destroy the component
               'Response.Write "done"
   
   
   
            if bDisplayForm = false then
                'this will avoid resubmitting the form if browser reload button is pressed
                Response.Redirect "default.asp?confirm=1"
            end if    
       
        case else
            if strConfirm = "1" then
                bDisplayForm = false
                   
                FormatMsgToUser "Your survey results were successfully saved.  Thank-you."
                   
            else
                bDisplayForm = true
            end if
    end select

    CleanUpGlobalObjects

end sub


sub CreateGlobalObjects
    on error resume next
    set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open ConnectString
   
end sub


sub CleanUpGlobalObjects
    on error resume next
    if oConn.state = 1 then
        oConn.close
    end if
    set oConn = nothing
end sub


sub SaveSurveyResponse()
    on error resume next
    dim strSQL, iRecordsAffected, adoRS, iResponseID, strSQL2, strBaseSQL
    iRecordsAffected = 0
   
   

    strSQL = "INSERT INTO SUR_Responses (DateEntered) VALUES ('" & now() & "')"

    oConn.Execute strSQL, iRecordsAffected
   
    set adoRS = Server.CreateObject("ADODB.RecordSet")
    Set adoRS = oConn.Execute("SELECT @@IDENTITY")
   
    if not (adoRS.EOF or adoRS.BOF) then
        iResponseID = adoRS(0)
    end if
   
    if err.number = 0 then
        strBaseSQL = "INSERT INTO SUR_ResponsesAnswers (ResponseID, QuestionNo, QuestionPartNo, AnswerID, Comment) " & _
                      "VALUES (" & iResponseID & ","
   
        strSQL2 = strBaseSQL & "1,0," & FormatSurveyOptionForDB(rq("selQ1")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "2,0," & FormatSurveyOptionForDB(rq("selQ2")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "3,0," & FormatSurveyOptionForDB(rq("radQ3")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "4,0," & FormatSurveyOptionForDB(rq("radQ4")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "5,0," & FormatSurveyOptionForDB(rq("radQ5")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "6,0," & FormatSurveyOptionForDB(rq("radQ6")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "7,0," & FormatSurveyOptionForDB(rq("selQ7")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "8,0," & FormatSurveyOptionForDB(rq("radQ8")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "9,0," & FormatSurveyOptionForDB(rq("radQ9")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "10,0," & FormatSurveyOptionForDB(rq("radQ10")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "11,0," & FormatSurveyOptionForDB(rq("radQ11")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "12,1," & FormatSurveyOptionForDB(rq("radQ12A")) & ",'" & FormatSurveyCommentForDB(rq("txtQ12A")) & "')" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "12,2," & FormatSurveyOptionForDB(rq("radQ12B")) & ",'" & FormatSurveyCommentForDB(rq("txtQ12B")) & "')" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "12,3," & FormatSurveyOptionForDB(rq("radQ12C")) & ",'" & FormatSurveyCommentForDB(rq("txtQ12C")) & "')" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "12,4," & FormatSurveyOptionForDB(rq("radQ12D")) & ",'" & FormatSurveyCommentForDB(rq("txtQ12D")) & "')" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "12,5," & FormatSurveyOptionForDB(rq("radQ12E")) & ",'" & FormatSurveyCommentForDB(rq("txtQ12E")) & "')" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "12,6," & FormatSurveyOptionForDB(rq("radQ12F")) & ",'" & FormatSurveyCommentForDB(rq("txtQ12F")) & "')" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "13,0," & FormatSurveyOptionForDB(rq("radQ13")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "14,0," & FormatSurveyOptionForDB(rq("radQ14")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "15,0," & FormatSurveyOptionForDB(rq("radQ15")) & ",NULL)" & vbCrLf
        strSQL2 = strSQL2 & strBaseSQL & "16,0,0,'" & FormatSurveyCommentForDB(rq("txtQ16")) & "')" & vbCrLf
       
                 
        oConn.Execute strSQL2, iRecordsAffected
       
        if err.number = 0 then
            bDisplayForm = false
        else
            bDisplayForm = true
            FormatMsgToUser "An error occurred while processing your request.  Please try again later."
            AddToDebugString "Error:SaveSurveyResponse(): " & err.number & " - " & err.Description, true
        end if
   
    else
        bDisplayForm = true
        FormatMsgToUser "An error occurred while processing your request.  Please try again later."
        AddToDebugString "Error:SaveSurveyResponse(): " & err.number & " - " & err.Description, true
    end if
   

    if blnDebug then
        AddToDebugString "strSQL=" & strSQL, true
        AddToDebugString "strSQL2=" & strSQL2, false
        AddToDebugString "iResponseID=" & iResponseID, false
        AddToDebugString "iRecordsAffected=" & iRecordsAffected, false
    end if
   
    if adoRS.State = 1 then
        adoRS.Close
    end if
    set adoRS = nothing
   
end sub

function FormatSurveyCommentForDB(str)
    if str <> "" then
        str = replace(str,"'","''")
    end if
    FormatSurveyCommentForDB = str
end function

function FormatSurveyOptionForDB(str)
    'used to manipulate text input for datbase storage
    if str = "" then
        str = "0"
    end if
    FormatSurveyOptionForDB = str
end function

'------------------------------------------------------------------------------
' END Server-side functions
' -----------------------------------------------------------------------------



'------------------------------------------------------------------------------
' BEGIN Global Server-side Variables
' -----------------------------------------------------------------------------

Dim blnDebug, strDebug

'to enable debugging
blnDebug = false

dim oConn, bDisplayForm, strMsgToUser

'------------------------------------------------------------------------------
' END Global Server-side Variables
' -----------------------------------------------------------------------------

call Main() 'sub controls main page logic for form submissions, etc.
%>


<html>
<head>
  <title>Apprentice Trades - Online Survey</title>
  <link rel="stylesheet" title="nn v4.x styles" href="/global.displaynn.css" media="screen">
  <style type="text/css">
    @import url(/global.display.css);
  </style>

<script src="/globalincludes/global.routines.js.inc" language="javascript" type="text/javascript"></script>

<SCRIPT LANGUAGE="JavaScript">
<!--
function hasSelection(strFieldName,strMessage){
     var objFormField = document.forms[0].elements[strFieldName];
     if (objFormField.selectedIndex == 0){
          alert("The " + strMessage + " cannot be blank.");
          objFormField.focus() ;
          return false ;
     }
     return true;
}

  function SubmitForm(mode)
  {
    var form = window.document.form1;

        switch (mode)
        {
           case "SAVESURVEY":
             
              form.userAction.value = mode;
              break;
        }
   
        form.submit();
  }

//-->
</script>

<style type="text/css">
  p { font-size: 16px; }
  td { font-size: 11px; }

</style>

</head>
<body bgcolor="#FFFFFF">

<h3><center>www.apprenticetrades.ca - Online Survey</center></h3>



<%= strMsgToUser %>


<%

if bDisplayForm then

%>

<p><strong>Description:</strong>
The <a href="http://www.apprenticetrades.ca" target="_blank">www.apprenticetrades.ca</a> web site is a one-stop source of Canadian apprenticeship information
</p>

<p><strong>Instructions:</strong>
Please take a few minutes fill out the survey below.  Your comments will help us to
improve the site.</p>

<p><b>Remember to submit your answers by pressing the "submit" button at
the end of the survey.</b></p>

<p>
  <center><img src="/images/color_frame.gif" width="97%" height="1" hspace="0" vspace="0"></center>
</p>


<p>
<b>General Information</b>
</p>

<form name="form1" action="default.asp" method="post" onSubmit = "return hasSelection('selQ1','Please select a Province!')">
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td valign="top">1.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Please select the Province/Territory in which you reside:
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="5" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <SELECT id=selQ1 name=selQ1>
            <OPTION value="">Select One</OPTION>
            <OPTION value="1">Alberta</OPTION>
            <OPTION value="2">British Columbia</OPTION>
            <OPTION value="3">Manitoba</OPTION>
            <OPTION value="4">New Brunswick</OPTION>
            <OPTION value="5">Newfoundland</OPTION>
            <OPTION value="6">Nova Scotia</OPTION>
            <OPTION value="7">Nunavut</OPTION>
            <OPTION value="8">Northwest Territories</OPTION>
            <OPTION value="9">Ontario</OPTION>
            <OPTION value="10">Prince Edward Island</OPTION>
            <OPTION value="11">Quebec</OPTION>
            <OPTION value="12">Saskatchewan</OPTION>
            <OPTION value="13">Yukon</OPTION>
          </SELECT>
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>

    <tr>
      <td valign="top">2.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Please select which best describes you:
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="5" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <SELECT id=selQ2 name=selQ2>
            <OPTION value="">Select One</OPTION>
            <OPTION value="1">Student</OPTION>
            <OPTION value="2">Young Adult</OPTION>
            <OPTION value="3">Apprentice</OPTION>
            <OPTION value="4">Journeyperson</OPTION>
            <OPTION value="5">Teacher / Guidance Counsellor</OPTION>
            <OPTION value="6">Instructor</OPTION>
            <OPTION value="7">Parent</OPTION>
            <OPTION value="8">Employer</OPTION>
            <OPTION value="9">Equity Seeking Group</OPTION>
            <OPTION value="10">Inventory Project Steering Committee Member</OPTION>
            <OPTION value="11">CAF-FCA Board Member</OPTION>
            <OPTION value="12">From an Employer Association</OPTION>
            <OPTION value="13">From a Labour Organization</OPTION>
            <OPTION value="14">From a Government Organization</OPTION>
            <OPTION value="15">Other</OPTION>

           
          </SELECT>
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>

    <tr>
      <td valign="top">3.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          How would you describe yourself when it comes to using the Internet?
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ3 name=radQ3 value="1">Beginner
          <INPUT type="radio" id=radQ3 name=radQ3 value="2">Intermediate
          <INPUT type="radio" id=radQ3 name=radQ3 value="3">Advanced
         
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>

    <tr>
      <td valign="top">4.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Which type of computer are you using?
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ4 name=radQ4 value="2">PC
          <INPUT type="radio" id=radQ4 name=radQ4 value="1">Mac
          <INPUT type="radio" id=radQ4 name=radQ4 value="3">Unsure
         
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>

    <tr>
      <td valign="top">5.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Which Web Browser are you currently using to review the www.apprenticetrades.com website?  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ5 name=radQ5 value="1">Netscape Navigator
          <INPUT type="radio" id=radQ5 name=radQ5 value="2">Internet Explorer
          <INPUT type="radio" id=radQ5 name=radQ5 value="3">Opera
          <INPUT type="radio" id=radQ5 name=radQ5 value="4">Other
          <INPUT type="radio" id=radQ5 name=radQ5 value="5">Unsure
         
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>


    <tr>
      <td valign="top">6.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Which version of web browser are you using?  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ6 name=radQ6 value="1" >Version 3 or less
          <INPUT type="radio" id=radQ6 name=radQ6 value="2" >Version 4
          <INPUT type="radio" id=radQ6 name=radQ6 value="3">Version 5
          <INPUT type="radio" id=radQ6 name=radQ6 value="4">Version 6
          <INPUT type="radio" id=radQ6 name=radQ6 value="5">Version 7
          <INPUT type="radio" id=radQ6 name=radQ6 value="6">Unsure
         
      </td>
    </tr>
   
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="40" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <b>Targeted Content Pages</b><br>
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="10" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
   

    <tr>
      <td valign="top">7.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">On the left hand side of the site there is a list of potential visitors to the website. If you clicked on one of these while exploring the site, please select it in the list below and answer questions 8 & 9 relating to that section of the website. If you did not click on one of these while exploring the site, please skip questions 7, 8 & 9 and go to question 10.

           
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="5" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <SELECT id=selQ7 name=selQ7>
            <OPTION value="">Select One</OPTION>
            <OPTION value="1">Students</OPTION>
            <OPTION value="2">Young Adults</OPTION>
            <OPTION value="3">Apprentices</OPTION>
            <OPTION value="4">Journeypersons</OPTION>
            <OPTION value="5">Teachers / Guidance Counsellors</OPTION>
            <OPTION value="6">Instructors</OPTION>
            <OPTION value="7">Parents</OPTION>
            <OPTION value="8">Employers</OPTION>
            <OPTION value="9">Equity Seeking Groups</OPTION>
           
          </SELECT>
         
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
   

    <tr>
      <td valign="top">8.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Was the information provided relevant to the group you selected?  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ8 name=radQ8 value="1" >The information was very relevant to the group selected<br>
          <INPUT type="radio" id=radQ8 name=radQ8 value="2">The information was somewhat relevant to the group selected<br>
          <INPUT type="radio" id=radQ8 name=radQ8 value="3">The information was not relevant to the information selected
         
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>


    <tr>
      <td valign="top">9.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          How would you rate the amount of information provided for the group you selected?  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ9 name=radQ9 value="1" >Not enough information was provided<br>
          <INPUT type="radio" id=radQ9 name=radQ9 value="2">An adequate amount of information was provided<br>
          <INPUT type="radio" id=radQ9 name=radQ9 value="3">Too much information was provided
      </td>
    </tr>
   
   
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="40" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <b>Information Finder</b><br>
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="10" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>


    <tr>
      <td valign="top">10.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          How would you rate the usability of the Information Finder?  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ10 name=radQ10 value="1" >Very easy to use
          <INPUT type="radio" id=radQ10 name=radQ10 value="2">Somewhat easy to use
          <INPUT type="radio" id=radQ10 name=radQ10 value="3">Somewhat difficult to use
          <INPUT type="radio" id=radQ10 name=radQ10 value="4">Very difficult to use
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
   

    <tr>
      <td valign="top">11.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Were the search results produced by the Information Finder relevant to what you were searching for?  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ11 name=radQ11 value="1" >The search results were very relevant<br>
          <INPUT type="radio" id=radQ11 name=radQ11 value="2">The search results were somewhat relevant<br>
          <INPUT type="radio" id=radQ11 name=radQ11 value="3">The search results were not relevant
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="40" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <b>Information on the Web Site</b><br>
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="10" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>


    <tr>
      <td valign="top">12.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          There are a number of featured "articles" within this website.  Please check off which articles you read while exploring the web site and answer the questions associated with that article.    
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="8" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>

    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
           Article: Frequently Asked Questions
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="right" valign="top" width="15">
        &nbsp;&nbsp;&nbsp;&nbsp;
      </td>
      <td align="left" valign="top">
          <INPUT type="radio" id=radQ12A name=radQ12A value="1">This article was clearly written and easy to read<br>
          <INPUT type="radio" id=radQ12A name=radQ12A value="2">This article was not clearly written and was difficult to read. Please comment why:<br>
          <TEXTAREA rows=2 cols=60 id=txtQ12A name=txtQ12A></TEXTAREA>
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="8" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>

    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
           The Cost of Apprenticeship
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="right" valign="top" width="15">
        &nbsp;&nbsp;&nbsp;&nbsp;
      </td>
      <td align="left" valign="top">
          <INPUT type="radio" id=radQ12B name=radQ12B value="1">This article was clearly written and easy to read<br>
          <INPUT type="radio" id=radQ12B name=radQ12B value="2">This article was not clearly written and was difficult to read. Please comment why:<br>
          <TEXTAREA rows=2 cols=60 id=txtQ12B name=txtQ12B></TEXTAREA>
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="8" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>

    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
           Tips for Employers
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="right" valign="top" width="15">
        &nbsp;&nbsp;&nbsp;&nbsp;
      </td>
      <td align="left" valign="top">
          <INPUT type="radio" id=radQ12C name=radQ12C value="1">This article was clearly written and easy to read<br>
          <INPUT type="radio" id=radQ12C name=radQ12C value="2">This article was not clearly written and was difficult to read. Please comment why:<br>
          <TEXTAREA rows=2 cols=60 id=txtQ12C name=txtQ12C></TEXTAREA>
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="8" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>

    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
           Starting a Career
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="right" valign="top" width="15">
        &nbsp;&nbsp;&nbsp;&nbsp;
      </td>
      <td align="left" valign="top">
          <INPUT type="radio" id=radQ12D name=radQ12D value="1">This article was clearly written and easy to read<br>
          <INPUT type="radio" id=radQ12D name=radQ12D value="2">This article was not clearly written and was difficult to read. Please comment why:<br>
          <TEXTAREA rows=2 cols=60 id=txtQ12D name=txtQ12D></TEXTAREA>
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="8" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>


    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
           The Basics
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="right" valign="top" width="15">
        &nbsp;&nbsp;&nbsp;&nbsp;
      </td>
      <td align="left" valign="top">
          <INPUT type="radio" id=radQ12E name=radQ12E value="1">This article was clearly written and easy to read<br>
          <INPUT type="radio" id=radQ12E name=radQ12E value="2">This article was not clearly written and was difficult to read. Please comment why:<br>
          <TEXTAREA rows=2 cols=60 id=txtQ12E name=txtQ12E></TEXTAREA>
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="8" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>


    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
           A Ticket To Canada
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="right" valign="top" width="15">
        &nbsp;&nbsp;&nbsp;&nbsp;
      </td>
      <td align="left" valign="top">
          <INPUT type="radio" id=radQ12F name=radQ12F value="1">This article was clearly written and easy to read<br>
          <INPUT type="radio" id=radQ12F name=radQ12F value="2">This article was not clearly written and was difficult to read. Please comment why:<br>
          <TEXTAREA rows=2 cols=60 id=txtQ12F name=txtQ12F></TEXTAREA>
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="40" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <b>Overall Satisfaction</b><br>
      </td>
    </tr>
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="10" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>


    <tr>
      <td valign="top">13.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Overall, did you find this website:  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ13 name=radQ13 value="1" >Very easy to navigate (very easy to use)<br>
          <INPUT type="radio" id=radQ13 name=radQ13 value="2">Somewhat easy to navigate (somewhat easy to use)<br>
          <INPUT type="radio" id=radQ13 name=radQ13 value="3">Somewhat difficult to navigate (somewhat difficult to use)<br>
          <INPUT type="radio" id=radQ13 name=radQ13 value="4">Very difficult to navigate (very difficult to use)
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>    

    <tr>
      <td valign="top">14.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Would you consider using this website in the future as a resource for apprenticeship information?  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ14 name=radQ14 value="1" >Yes
          <INPUT type="radio" id=radQ14 name=radQ14 value="2">No
          <INPUT type="radio" id=radQ14 name=radQ14 value="3">Maybe
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>  


    <tr>
      <td valign="top">15.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Would you recommend this website to others as a good resource for apprenticeship information?  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <INPUT type="radio" id=radQ15 name=radQ15 value="1" >Yes
          <INPUT type="radio" id=radQ15 name=radQ15 value="2">No
          <INPUT type="radio" id=radQ15 name=radQ15 value="3">Maybe
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="15" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>    


    <tr>
      <td valign="top">16.&nbsp;&nbsp;</td>
      <td align="left" colspan="2">
          Do you have any comments or suggestions to improve the website?  Be as general or specific as you wish.  
      </td>
    </tr>
    <tr>
      <td align="right" valign="top" width="5">&nbsp;
       
      </td>
      <td align="left" valign="top" colspan="2">
          <TEXTAREA rows=4 cols=60 id=txtQ16 name=txtQ16></TEXTAREA>
      </td>
    </tr>
   
    <tr>
      <td colspan="3">
        <img src="<% spacer() %>" width="1" height="20" hspace="0" vspace="0" alt=""><br>
      </td>
    </tr>  
   
      <tr>
      <td colspan="3" valign="top" align="center">Thank you for taking the time to complete this survey.</td>
    </tr>
                       
  </table>
 
 
  <input type="hidden" name="userAction" value="">
 
 

<p align=center>
  <input type="button" onclick="javascript:SubmitForm('SAVESURVEY');" value="Submit Survey" id=butSubmit name=butSubmit>
</p>
</form>

<%
else
%>

<br>
<p align=center>
The Canadian Apprenticeship Forum - Forum canadien sur l'apprentissage would like to thank you for taking the time to complete this survey.
</p>

<%
end if
%>

<p>
<center><a href="javascript:window.close();self.close();">Close Window</a></center>
</p>

<%
if blnDebug then
  writeln "<br><br><br>===========  DEBUG INFO ================<br><br>"
  writeln strDebug
end if
%>


</body>
</html>



FtB
0
 

Author Comment

by:elieazzi
Comment Utility
I've posted if  I don't select any province i'm getting this error.

Microsoft VBScript runtime error '800a000d'

Type mismatch: '[object]'

/en/survey/default.asp, line 61

FYI, where line 61 is    strProvince = arrProvinces(request.form("selQ1"))

Pls. advice.

Elie.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
Ah! I see. Hang on a minute...

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
Okay, change this line:

            <OPTION value="">Select One</OPTION>


to this:

            <OPTION value="0">Select One</OPTION>

FtB
0
 

Author Comment

by:elieazzi
Comment Utility
Fritz,

Is still the same as error:

Microsoft VBScript runtime error '800a000d'

Type mismatch: '[object]'

/en/survey/default.asp, line 61


Refereing to line 61 i've mentioned above.

tks.  What do you think...
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
Did you make your change, clear your browser cache, and then try again?

FtB
0
 

Author Comment

by:elieazzi
Comment Utility
Hello Fritz,

My appology I was saving under different folder... I've make the change it's working.

Now If i don't select any province, the form will go... My question is there a way to show a msg to the user that

NOTE: You didn't select your province. this is a mandatory field. please select a  province.

I think in this case it should be JavaScript what do you trhink, pls. advice.

Thank you for your time.
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 500 total points
Comment Utility
Okay, I am happy that we have the first issue resolved. Now, is there a link where I can visit this page to see why my javascript isn't working?

FtB
0
 

Author Comment

by:elieazzi
Comment Utility
Hello Fritz,

Here is this page, I'm talking about it.

http://www.apprenticetrades.ca/en/test/

Please let me know what do you think.  The issue if you load the page, then click SUBMIT, there is not taking the province field as a mandatary field.  Please let me know if you got my idea.

Thank you for your time.

Regards,
Elie.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
Comment Utility
I am tied up teaching at the university today I will take a look at this tomorrow to see why this is failing. Please drop a note here tomorrow to remind me to look.

FtB
0
 

Author Comment

by:elieazzi
Comment Utility
Thank you for your time and help.  God bless you!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now