Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
JavaScript
Function thutucdequycombo(idc,i)
	Set objConn = Server.CreateObject("ADODB.Connection")
	objConn.ConnectionString = strConnection
	objConn.Open 
	Set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open "SELECT * From rtm_area Where parent_aid = "&idc ,objconn, 1, 3
	k = rs.recordcount
	j=1
	while not rs.eof		
		 	IF rs("parent_aid") <> idc Then 
		 		Option_select_03 = Option_select_03 & "<option value=""" & rs("aid") & """>" & rs("name") & "</option>"
		 	Else
		 		Option_select_03 = Option_select_03 & "<option value=""" & rs("aid") & """>  " & rs("name") & "</option>"
		 	End IF		 	
			thutucdequycombo rs("aid"),rs("parent_aid") ' Goi lai chinh no - dequy	
	rs.movenext
	j=j+1
	'response.write"           "
	wend
End Function	
thutucdequycombo 0,0

Table:
HTML
aid: int
name: nvachar 50
parent_id: int

I want create dynamic combox n lever
HTML
Leve1
   1-1
   1-2
Lever2
   2-1
   2-2
      2-3
.......

How to ?
Posted
Updated 20-Sep-12 18:14pm
v2

Your "n-level combo box" is a well-known simple thing: tree view. More exactly, it's a tree view with additional element: a text box (<input> element of the text type) where you should handle key presses to move selection in the tree view like in a combo box. The behavior of this additional element is not quite clear, because combo boxes also has several behavioral patterns (implemented in one type); and I don't know what exactly behavior do you need. You need to design and implement it by yourself anyway.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900