I have a search engine where the user submits a form, and the results are taken from a database and then a summary is displayed. The user then clicks on the summary to open a javascript window containing a form with the full results for that particular record.
The problem is, that no matter how many results are displayed in the summary, whichever one you click on, only the datasheet for the first result returned is shown in the new window. I have got this to work when opening in a normal window, but wanted to use javascript to have a standard sized window. The relevant bit of code is as follows:
<script language=JavaScript>
var formdata ='resultsform.asp?IDNumber= <%=objRS("ID Number"%> &PartName= <%=objRS("Part Name"%> &PartApplication= <%=objRS("Part Application"%> &Country= <%=objRS("Country"%> &Approver= <%=objRS("Approver"%> &Modified= <%=objRS("Date Last Modified"%> &Added= <%=objRS("Date Added"%> &DocType= <%=objRS("Document Type"%>'
function openWindow() {
window.open(formdata,"Results","width=250,height=350"
}
</script>
.......................................
<%
If objRS.Recordcount > 0 then
Response.Write "<table>"
Do until objRS.EOF
Response.Write "<tr>"
Response.Write "<td width='100%'><a href = javascriptpenWindow()><font size='2' face='Arial' color='#336699'>" & objRS("ID Number" & " " & objRS("Part Name" & "</font></td></a>"
Response.Write "</tr>"
objRS.Movenext
loop
etc. etc.
Any suggestions would be appreciated (and I'm new to this, so I need idiot-proof instructions!!) Thanks!
The problem is, that no matter how many results are displayed in the summary, whichever one you click on, only the datasheet for the first result returned is shown in the new window. I have got this to work when opening in a normal window, but wanted to use javascript to have a standard sized window. The relevant bit of code is as follows:
<script language=JavaScript>
var formdata ='resultsform.asp?IDNumber= <%=objRS("ID Number"%> &PartName= <%=objRS("Part Name"%> &PartApplication= <%=objRS("Part Application"%> &Country= <%=objRS("Country"%> &Approver= <%=objRS("Approver"%> &Modified= <%=objRS("Date Last Modified"%> &Added= <%=objRS("Date Added"%> &DocType= <%=objRS("Document Type"%>'
function openWindow() {
window.open(formdata,"Results","width=250,height=350"
}
</script>
.......................................
<%
If objRS.Recordcount > 0 then
Response.Write "<table>"
Do until objRS.EOF
Response.Write "<tr>"
Response.Write "<td width='100%'><a href = javascriptpenWindow()><font size='2' face='Arial' color='#336699'>" & objRS("ID Number" & " " & objRS("Part Name" & "</font></td></a>"
Response.Write "</tr>"
objRS.Movenext
loop
etc. etc.
Any suggestions would be appreciated (and I'm new to this, so I need idiot-proof instructions!!) Thanks!