...

View Full Version : Pop-up window with selected value



Cuttie0506
02-28-2006, 06:43 AM
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



function open_win() {
window.open("openEditLink.asp")
}



Code to display the dropdown list and get the value



<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)


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

degsy
02-28-2006, 02:28 PM
function open_win(el) {
vul = el.options[el.selectedIndex].value;
url = 'openEditLink.asp?vulLink=' + vul;
window.open(url)
}



<td><select name=vulLink id=select onchange ="open_win(this)">




Source = "SELECT * FROM Security_Vulnerability WHERE Vul_No=" & request.QueryString("vulLink")

Cuttie0506
03-01-2006, 01:06 AM
thanx!

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum