I have a select in an ASP page that is being populated by a database table. I am trying to open a new browser window with the html page associated to the record in my DB. I have attached a copy of my code below. I want to get the info from a certain field in the currently selected record to be the XXXX.html page I am trying to open with the submit button.
<html>
<HEAD>
<%'To check the browser capabilities this goes above everything
function checkbrowser
Set check = server.createObject("MSWC.BrowserType"
if check.browser="IE" and check.version >= "4.0" Then
checkbrowser = "DropStyle"
Else
checkbrowser = ""
End if
End function
'this goes in the head. very basic CSS
%>
</HEAD>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
Sub ShowProduct_onClick
window.open "/documents/products/images/XXXX.html"
End Sub
</SCRIPT>
<%
Set DBObj = Server.CreateObject("ADODB.Connection"
DBObj.Open "Imalog-DB"
SQLQuery = "SELECT proProduct, proName, proDescription FROM Products"
Set RSProducts = DBObj.Execute(SQLQuery)
%>
<CENTER>
<FONT FACE="Comic Sans MS">
<H1>List of Proucts</H1>
<form>
<select name="proName" size="1">
<OPTION value="">Please Select a Product</OPTION>
<OPTION value="">-----------------------</OPTION>
<% Do While Not RSProducts.EOF %>
<option><%=RSPRoducts("proName"
%></option>
<%
RSProducts.MoveNext
Loop
DBObj.Close
%>
<input type=button value="Submit" name="ShowProduct" tabindex="1">
</form>
</html>
<html>
<HEAD>
<%'To check the browser capabilities this goes above everything
function checkbrowser
Set check = server.createObject("MSWC.BrowserType"
if check.browser="IE" and check.version >= "4.0" Then
checkbrowser = "DropStyle"
Else
checkbrowser = ""
End if
End function
'this goes in the head. very basic CSS
%>
</HEAD>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
Sub ShowProduct_onClick
window.open "/documents/products/images/XXXX.html"
End Sub
</SCRIPT>
<%
Set DBObj = Server.CreateObject("ADODB.Connection"
DBObj.Open "Imalog-DB"
SQLQuery = "SELECT proProduct, proName, proDescription FROM Products"
Set RSProducts = DBObj.Execute(SQLQuery)
%>
<CENTER>
<FONT FACE="Comic Sans MS">
<H1>List of Proucts</H1>
<form>
<select name="proName" size="1">
<OPTION value="">Please Select a Product</OPTION>
<OPTION value="">-----------------------</OPTION>
<% Do While Not RSProducts.EOF %>
<option><%=RSPRoducts("proName"
<%
RSProducts.MoveNext
Loop
DBObj.Close
%>
<input type=button value="Submit" name="ShowProduct" tabindex="1">
</form>
</html>