Akasha Posted January 16, 2006 Share Posted January 16, 2006 Hello peeps,i have this problem i can't figure out.I use ASP and have a formwith 2 dropdown menusthe first one gets filled with a querywhen someone makes a choice in the first dropdown menuthe second must contain the choices related to the first choice in dropdown menu 1Dropdown menu als needs to be filled with a query.what code needs in the function??or do you have another solution?? function changeHoofdcat(){ ?????}........<form name='form' method='post' action='links.asp'><select name="hoofdcategorie" onchange="go()"><option value=''>--- Select a category ---<% set rs2 = Server.CreateObject("ADODB.recordset") rs2.Open "SELECT * FROM Hoofdcategorieen WHERE hoofdcat_id > 1 ORDER BY hoofdcat_name ASC", conn2 'Fill variables with values Do until rs2.EOF Response.Write("<OPTION value='" & rs2.fields("hoofdcat_name") & "'>" & rs2.fields("hoofdcat_name") & "</option>") rs2.movenext Loop rs2.close%></select><br/><select name="categorie" onchange="go()"><option value=''>--- Select a category ---<% set rs2 = Server.CreateObject("ADODB.recordset") rs2.Open "SELECT c.*, h.hoofdcat_id FROM hoofdcategorieen h, categorieen c WHERE h.hoofdcat_name='"&SelValue&"' AND h.hoofdcat_id= c.hoofdcat_id ORDER BY c.cat_name ASC", conn2 'Fill variables with values Do until rs2.EOF Response.Write("<OPTION value='" & rs2.fields("hoofdcat_name") & "'>" & rs2.fields("hoofdcat_name") & "</option>") rs2.movenext Loop rs2.close%></select> GreetzLeandra Link to comment Share on other sites More sharing options...
Akasha Posted January 16, 2006 Author Share Posted January 16, 2006 Hmz.. ok now he fills my second dropdownbut loses the inserted value in dropdown menu 1is there a way to keep thos values ? Link to comment Share on other sites More sharing options...
Akasha Posted January 16, 2006 Author Share Posted January 16, 2006 Already found a solution for that Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now