Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP
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:
aid: int
name: nvachar 50
parent_id: int
I want create dynamic combox n lever
 Leve1
    1-1
    1-2
 Lever2
    2-1
    2-2
       2-3 
 .......
How to ?
Posted 20-Sep-12 19:10pm
Edited 20-Sep-12 19:14pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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

  Print Answers RSS
0 Peter Leow 375
1 Sergey Alexandrovich Kryukov 270
2 Zoltán Zörgő 258
3 CHill60 195
4 TheRealSteveJudge 180
0 Sergey Alexandrovich Kryukov 8,853
1 OriginalGriff 6,631
2 Peter Leow 4,102
3 Zoltán Zörgő 3,714
4 Kornfeld Eliyahu Peter 2,525


Advertise | Privacy | Mobile
Web02 | 2.8.150123.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100