I am generating HTML within a VB cls. This object is invoked from an ASP Page. The Page generates Fine, but I am having problems with My onchange function. Here are the snippits of my code. The intent is, when my selection box changes I want this onclick function to envoke and redirect itself back to the same page.....
' this is my function
ASPresponse.Write "<HEAD>"
ASPresponse.Write "<script ID=clientEventHandlersJS LANGUAGE=javascript>"
ASPresponse.Write "<!--"
ASPresponse.Write "function sCompany_onchange() {"
ASPresponse.Write "Var intCompanyID"
ASPresponse.Write "Var strURL"
ASPresponse.Write "intCompanyID=frmMain.sCompany.value" 'gets the selected company's id
ASPresponse.Write "strURL = 'LogIncident.asp?intCompanyID=' + intCompanyID"
ASPresponse.Write "location = strURL" 'will redirect the page to itself with the company id in the querystring"
ASPresponse.Write "}"
ASPresponse.Write "//-->"
ASPresponse.Write "</script>"
' this is where I call my function
ASPresponse.Write "<TD Width=450><SELECT name=sCompany id=sCompany LANGUAGE=javascript onchange=return sCompany_onchange()"
Any help?
' this is my function
ASPresponse.Write "<HEAD>"
ASPresponse.Write "<script ID=clientEventHandlersJS LANGUAGE=javascript>"
ASPresponse.Write "<!--"
ASPresponse.Write "function sCompany_onchange() {"
ASPresponse.Write "Var intCompanyID"
ASPresponse.Write "Var strURL"
ASPresponse.Write "intCompanyID=frmMain.sCompany.value" 'gets the selected company's id
ASPresponse.Write "strURL = 'LogIncident.asp?intCompanyID=' + intCompanyID"
ASPresponse.Write "location = strURL" 'will redirect the page to itself with the company id in the querystring"
ASPresponse.Write "}"
ASPresponse.Write "//-->"
ASPresponse.Write "</script>"
' this is where I call my function
ASPresponse.Write "<TD Width=450><SELECT name=sCompany id=sCompany LANGUAGE=javascript onchange=return sCompany_onchange()"
Any help?