doubt in Classic ASP
-
Integrator: <Select name=Integrator id=Integrator Size=1 onChange= <% dim sqlTemp dim arrRSTemp dim ConnTemp : Set ConnTemp = cf_OpenConnection() sqlTemp = "Select * from Integrator where atnINtegratorID = 1" set arrRSTemp = Conn.Execute(sqlTemp) Response.Write "Integrator Address: " & arrRSTemp("txtIntegratorAddress") Response.Write "<br>" %>> <option value=''>**No Integrator**</option> <% do until arrRS_Integrator.EOF Response.Write "<option value='" & arrRS_Integrator.Fields(0).value & "'" Response.Write ">" & arrRS_Integrator.Fields(1).value & "</option>" & vbcrlf Call arrRS_Integrator.moveNext() loop %> </select> </code> I have a combo which is used to dropdown some info. Now i want do some coding in the onchange event, as shown above. is this possible? please help me in this, because the code above is not working a bit. NB: I'm a beginner
-
Integrator: <Select name=Integrator id=Integrator Size=1 onChange= <% dim sqlTemp dim arrRSTemp dim ConnTemp : Set ConnTemp = cf_OpenConnection() sqlTemp = "Select * from Integrator where atnINtegratorID = 1" set arrRSTemp = Conn.Execute(sqlTemp) Response.Write "Integrator Address: " & arrRSTemp("txtIntegratorAddress") Response.Write "<br>" %>> <option value=''>**No Integrator**</option> <% do until arrRS_Integrator.EOF Response.Write "<option value='" & arrRS_Integrator.Fields(0).value & "'" Response.Write ">" & arrRS_Integrator.Fields(1).value & "</option>" & vbcrlf Call arrRS_Integrator.moveNext() loop %> </select> </code> I have a combo which is used to dropdown some info. Now i want do some coding in the onchange event, as shown above. is this possible? please help me in this, because the code above is not working a bit. NB: I'm a beginner
AFAIK, this is not the correct way of doing it. You must know that
onChange
function of the Select box will be executed on the client side. You have written code that will be executed on the server, which is wrong. So what you could do is:onChange
of combo box, write a javascript function which will post back the page to itself. Pass the selected id in the QueryString. Now check for the corresponding QueryString in the page. If value is not null, write the code to get values from database (which you have already written). The important thing here is you need to understand how Classic ASP works. Once you know that, it would be easy for you to write code using Classic ASP.Xandip wrote:
NB: I'm a beginner
I would suggest you to go for ASP.NET if you are starting with Classic ASP. It has a lot of advantages over Classic ASP. You can always Google for them. :rolleyes:
..Go Green..