SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get value of combobox during Combobox index change in server side

    Hi,

    I have one asp code like this

    HTML Code:
    <tr>
    	<td  style="WIDTH:430px"><b>Release type</td>
    	<td><SELECT style="LEFT: 454px; WIDTH: 220px; TOP: 413px" name="txtrt" id="txtrt">
    	<OPTION value="" selected></OPTION>
    <OPTION value="Kernel">Kernel</OPTION>
    	<OPTION value="Cluster">Cluster</OPTION>
    	<OPTION value="Custom">Custom</OPTION>
    	</SELECT></td>
    
    	<tr><td><b>Release Version</td>
    <td>
    	<%    
    	rtyp=Request.Form("txtrt")
    	  Set con=server.CreateObject("adodb.connection")
    			con.Open session("Psrconnect")
    			Set rs=server.CreateObject("Adodb.Recordset")
    	
    			
    			rs.Open "select release_name from release_statistics where release_type='"&rtyp&"'",con
    			
    			
    	%>				
    	<SELECT style="LEFT: 454px; WIDTH: 220px; TOP: 413px" name="txtconsol2" id="txtconsol2">
    	<OPTION value="Select Release" >Select Release</OPTION>
    	<% do while rs.eof<>true
    					
    	%>
    	<OPTION value="<%=rs.fields(0)%>" ><%=rs.fields(0)%>  </OPTION>
    	
    	<%
    	rs.movenext 
    	loop
    	%>
    Here, I am not able to get the value of 'txtrt' to rtyp. request.Form is working in other parts of the page. Why this is happening. how can get the value of 'txtrt', so that I can retrieve values from database based on that. Please help. I am playing around the problem for the last 2days. Is there is any alternate way to do this. I can get the value of txtrt using vb script. But,how can i pass that value to server side so that i can retrieve values from database

  2. #2
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Display query results in Combobox2 based on the selected value of Combobox1

    Hi,
    I have two comboboxes,say cb1 and cb2. cb1 has 3 values,say dept1,dept2,dept3. When the value of cb1 changes,I want to retrieve values from oracle database based on the value of dept1, i.e,if I select dept1,i need to get 'select name from table1 where dept="dept1". If the selected value was dept2,then the query should be like this,'select name from table1 where dept="dept2".Then,cb2 should display all the names resulting from query.How can I do this in an asp page. Pls help. I am very new to classic asp and vb.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •