Hi,
I am designing a system for my company that logs training programmes they have been on. I have a table which holds various fields (the 2 of which im interested in are course_id and coursename). I have an ASP page which contains an evaluation form that staff can use to put their views on each training course forward. In this form there is a combo box which holds the course_id and the coursename of every course run. The code for my combobox is as follows:
Code:
<select name=coursecombobox>
<%
Do While Not display1.EOF
response.write "<option value = " & chr(34) & display1("course_id") & chr(34) & display1("coursename") & chr(34) & " >"
response.write display1("course_id") & " " & display1("coursename") & "</option>
display1.MoveNext
loop
%>
</select>
What I need to do is when users click submit, the course_id goes to the course_id field in my evaluation table, and the coursename value goes to the coursename field in my evaluation table. This is not happening at the moment. The code I am using to send all my data to the evaluation table is as follows:
Code:
evaluation.AddNew
evaluation("user_id") = session("UID")
evaluation("course_id") = Request.Form("courselistbox("display1("course_id")")")
evaluation("coursename") = Request.Form("courselistbox("display1("coursename")")")
evaluation("session_relevance_rating") = Request.Form("qSessionRelevanceListbox")
evaluation("session_relevance_comments") = Request.Form("qSessionRelevanceComments")
evaluation("tutor_balance_input_rating") = Request.Form("qTutorBalanceListbox")
evaluation("tutor_balance_input_comments") = Request.Form("qTutorBalanceComments")
evaluation("course_interesting_rating") = Request.Form("qCourseInterestingListbox")
evaluation("course_interesting_comments") = Request.Form("qCourseInterestingComments")
evaluation("course_aims_rating") = Request.Form("qCourseAimsListbox")
evaluation("course_aims_comments") = Request.Form("qCourseAimsComments")
evaluation("effective_trainers_rating") = Request.Form("qEffectiveTrainersListbox")
evaluation("effective_trainers_comments") = Request.Form("qEffectiveTrainersComments")
evaluation("overall_organisation_rating") = Request.Form("qOverallOrganisationListbox")
evaluation("overall_organisation_comments") = Request.Form("qOverallOrganisationComments")
evaluation("venue_facilities_rating") = Request.Form("qVenueFacilitiesListbox")
evaluation("venue_facilities_comments") = Request.Form("qVenueFacilitiesComments")
evaluation("aspects_most_useful") = Request.Form("qAspectsMostUsefulComments")
evaluation("aspects_most_useful_reasons") = Request.Form("qAspectsMostUsefulReasonsComments")
evaluation("aspects_least_useful") = Request.Form("qAspectsLeastUsefulComments")
evaluation("aspects_least_useful_reasons") = Request.Form("qAspectsLeastUsefulReasonsComments")
evaluation("training_session_improve") = Request.Form("qTrainingSessionImproveComments")
evaluation("day_to_day_incorporation") = Request.Form("qDayToDayIncorporationComments")
evaluation("comments") = Request.Form("qComments")
evaluation("hear_about_course") = Request.Form("qHearAboutCourseComments")
evaluation("additional_training") = Request.Form("allcourselistbox")
evaluation("other_training") = Request.Form("qOtherTrainingComments")
evaluation("posteddate") = Date
evaluation.Update
Sorry if im being a bit vague. Can anyone give me any pointers as to where im going wrong? The error message I get is as follows:
Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/devdata/sendevaluationform.asp, line 22, column 55
which applies to the following line in the above code:
Code:
evaluation("course_id") = Request.Form("courselistbox("display1("course_id")")")
Thanks!