DrSeussFreak
Programmer
I have this ASP page that has 3 drop down boxes. #1 influences what is in #2, and #2 influences #3.
That works fine. When I have the values set on the page, I try to use next or previous buttons and when I do, they clear all the settings in the drop downs and just start to browse all records instead of my selected records.
Anyone have a good idea as how to code the browse buttons so it keeps the values and browses the rest of the record set.
Below is the code that does the drop downs.
Thanks!
That works fine. When I have the values set on the page, I try to use next or previous buttons and when I do, they clear all the settings in the drop downs and just start to browse all records instead of my selected records.
Anyone have a good idea as how to code the browse buttons so it keeps the values and browses the rest of the record set.
Below is the code that does the drop downs.
Thanks!
Code:
<table width="800" border="1" align="center" bordercolor="#000000">
<tr bgcolor="#CCCCCC">
<td colspan="5" align="center" valign="middle" bordercolor="#D4D0C8" bgcolor="#FFFFFF" class="PageHeader">Product Information</td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2" bgcolor="#CCCCCC"><span class="RowTitles"><strong>Please Select From List Boxes: </strong></span></td>
<td width="34" rowspan="4" bgcolor="#8EAAC0"> </td>
<td bgcolor="#CCCCCC" colspan="2"><span class="RowTitles"><strong>Other Options: </strong></span></td>
</tr>
<tr>
<td width="112" align="left" valign="middle" class="Titles"><strong>Products's</strong>:</td>
<td width="171" align="left" valign="middle" class="Titles">
<select name="slProducts" size="1" onChange="document.forms['frmSelect'].action = 'ViewProductInfo.asp?pID=<%= Request.Form("slProducts") %>'; submit();">
<option value="" <%If (Not isNull(Request.Form("slProducts"))) Then If ("" = CStr(Request.Form("slProducts"))) Then Response.Write("SELECTED") : Response.Write("")%>>Please Select a Product</option>
<%
While (NOT rcdsetProducts.EOF)
%>
<option value="<%=(rcdsetProducts.Fields.Item("Product").Value)%>" <%If (Not isNull(Request.Form("slProducts"))) Then If (CStr(rcdsetProducts.Fields.Item("Product").Value) = CStr(Request.Form("slProducts"))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rcdsetProducts.Fields.Item("Product").Value)%></option>
<%
rcdsetProducts.MoveNext()
Wend
If (rcdsetProducts.CursorType > 0) Then
rcdsetProducts.MoveFirst
Else
rcdsetProducts.Requery
End If
%>
</select> </td>
<td width="168" align="center" valign="middle" class="Links"><a href="#" onclick="window.open('Search.asp','_blank','width=750,height=310,scrollbars=yes')">Search in a new window </a></td>
<td width="281" align="center" valign="middle" class="DateTime"><SCRIPT LANGUAGE="JavaScript1.2">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! [URL unfurl="true"]http://javascript.internet.com[/URL] -->
<!-- Begin
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000)
year = year + 1900;
document.write("<center><b>" + lmonth + " ");
document.write(date + ", " + year + "</b></center>");
// End -->
</SCRIPT></td>
</tr>
<tr>
<td align="left" valign="middle" class="Titles"><strong>Item's:</strong></td>
<td align="left" valign="middle" class="Titles">
<select name="slItems" onChange="document.forms['frmSelect'].action = 'ViewProductInfo.asp?pID=<%= Request.Form("slProducts") %>&iID=<%= Request.Form("slItems") %>'; submit();">
<option value=" " <%If (Not isNull(Request.Form("slItems"))) Then If (" " = CStr(Request.Form("slItems"))) Then Response.Write("selected=""selected""") : Response.Write("")%>></option>
<%
While (NOT rcdsetItems.EOF)
%>
<option value="<%=(rcdsetItems.Fields.Item("Item").Value)%>" <%If (Not isNull(Request.Form("slItems"))) Then If (CStr(rcdsetItems.Fields.Item("Item").Value) = CStr(Request.Form("slItems"))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(rcdsetItems.Fields.Item("Item").Value)%></option>
<%
rcdsetItems.MoveNext()
Wend
If (rcdsetItems.CursorType > 0) Then
rcdsetItems.MoveFirst
Else
rcdsetItems.Requery
End If
%>
</select> </td>
<td align="center" valign="middle" class="Links"><a href="Index.htm">Home</a></td>
<td align="center" valign="middle" class="DateTime"><span id=clock style="position:relative;"></span></td>
</tr>
<tr>
<td height="26" align="left" valign="middle" class="Titles"><strong>Manufacturer's:</strong></td>
<td align="left" valign="middle" class="Titles">
<select name="slManufacturers" onChange="document.forms['frmSelect'].action = 'ViewProductInfo.asp?pID=<%= Request.Form("slProducts") %>&iID=<%= Request.Form("slItems") %>&mID=<%= Request.Form("slManufacturers") %>'; submit();">
<option value=" " <%If (Not isNull(Request.Form("slManufacturers"))) Then If (" " = CStr(Request.Form("slManufacturers"))) Then Response.Write("selected=""selected""") : Response.Write("")%>></option>
<%
While (NOT rcdsetManufacturers.EOF)
%>
<option value="<%=(rcdsetManufacturers.Fields.Item("Manufacturer").Value)%>" <%If (Not isNull(Request.Form("slManufacturers"))) Then If (CStr(rcdsetManufacturers.Fields.Item("Manufacturer").Value) = CStr(Request.Form("slManufacturers"))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(rcdsetManufacturers.Fields.Item("Manufacturer").Value)%></option>
<%
rcdsetManufacturers.MoveNext()
Wend
If (rcdsetManufacturers.CursorType > 0) Then
rcdsetManufacturers.MoveFirst
Else
rcdsetManufacturers.Requery
End If
%>
</select> </td>
<td align="center" class="Titles">
Quick Search:</td>
<td colspan="1" align="center" class="Titles">
<input name="txtQuickSearch" type="text" >
<input type="button" name="btnSearch" value="Search" onclick="window.location='ViewProductInfoQSResults.asp'"></td>
</tr>
</table>