Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2005
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pop-up window with selected value

    Hi, i have a dropdown list.
    Once i selected a value, it will automatically pop up a new window, displaying the values. The values will get from the db using the selected dropdown list value..
    However, i cant get the value for my dropdown list..
    How shld i get it?


    Javascript code to pop up new window
    Code:
    	function open_win() {
    		window.open("openEditLink.asp")
    			}
    Code to display the dropdown list and get the value
    Code:
    <tr><td>Vulnerability Link: </td> 
    <td><select name=vulLink id=select onchange ="open_win()">
    		<option value="none">--Select Link--
    		<%While (NOT rs_vulLink.EOF)%>	
    			<option value="<%=(rs_vulLink.Fields.Item("vul_no").Value)%>"<%If (Not isNull((Session("vulLink")))) Then If (CStr(rs_vulLink.Fields.Item("vul_no").Value) = CStr((Session("vulLink")))) Then Response.Write("SELECTED")%>><%=(rs_vulLink.Fields.Item("vul_no").Value)%></option>
    		<%
    			rs_vulLink.MoveNext()
    			Wend
    
    			If (rs_vulLink.CursorType > 0) Then
    			rs_vulLink.MoveFirst
    
    			Else
    			rs_vulLink.Requery
    			End If
    		%>
    </select></td></tr>

    Codes to display the values (pop up window)
    Code:
    Dim rs_viewRec
    
    Set rs_viewRec = Server.CreateObject("ADODB.Recordset")
    rs_viewRec.ActiveConnection = MM_dsprms_STRING
    rs_viewRec.Source = "SELECT * FROM Security_Vulnerability WHERE Vul_No= '" & request.form("vulLink") & "'"
    rs_viewRec.CursorType = 0
    rs_viewRec.CursorLocation = 2
    rs_viewRec.LockType = 1
    rs_viewRec.Open()
    
    response.write rs_viewRec.source
    Thanx

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    function open_win(el) {
    		vul = el.options[el.selectedIndex].value;
    		url = 'openEditLink.asp?vulLink=' + vul;
    		window.open(url)
    			}
    Code:
    <td><select name=vulLink id=select onchange ="open_win(this)">
    Code:
    Source = "SELECT * FROM Security_Vulnerability WHERE Vul_No=" & request.QueryString("vulLink")

  • #3
    New Coder
    Join Date
    Jan 2005
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanx!

    i used a checkbox to get my session for the dropdown and manage to view..


  •  

    Posting Permissions

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