If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Pop-up window with selected value

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-28-06, 01:43
Cuttie0506 Cuttie0506 is offline
Registered User
 
Join Date: Jan 2006
Posts: 44
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
Reply With Quote
  #2 (permalink)  
Old 02-28-06, 18:13
gflken gflken is offline
Registered User
 
Join Date: Feb 2006
Location: Seattle / Eastside
Posts: 10
Quote:

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>
Normally I debug something like this by looking at the output code (view source on html page)...that should help. Could it be that you didn't close your first option tag (after --Select Link--)? I've colored it above for quick reference.

I'd dig into this more as I really like this kind of stuff, but I must run for now -I'll check back later -

Best of luck!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On