Beanie Man
04-27-2007, 02:38 AM
Hi all,
I have a frustrating problem with a search page that wont hold the values entered by the user in two dynamic drop down boxes when the search is refreshed. Ive managed to hold the values of the non dynamically generated drop boxes with a combination of asp and JavaScript.
If you visit my web site http://www.wheretobuycarsfrom.com/buyacar.asp and search for a car the results page will fail to keep the value of the Make and Model you searched for.
The options for these two form fields are generated by the file http://www.wheretobuycarsfrom.com/list.js and the function fillCatagory() is called by a body onload attribute.
The form that generates the search has the dynamic selection boxes as follows with some asp to gather the values of the fields.(ive left out the other form fields so as not to clutter things up too much)
<select class="fieldmake" NAME="Make" onChange="SelectsubCat();"
<%
if request.querystring("Make") <> "" then response.write " value = """ & request.querystring("Make") & """"
%>
>
<Option>Any Make</option>
</select>
</td>
<td class="formtablecell">
<select class="fieldmodel" id="Model" NAME="Model">
<Option value="Any Model">Any Model</option>
</select>
Then at the foot of the search results page i have the following to fill the fields;
<script type="text/javascript">
drop_list.Make.value = "<% = request.querystring("Make") %>"
drop_list.Make.value = "<% = request.querystring("Model") %>"
drop_list.D3.value = "<% = request.querystring("D3") %>"
drop_list.D1.value = "<% = request.querystring("D1") %>"
drop_list.D2.value = "<% = request.querystring("D2") %>"
drop_list.search_postcode.value = "<% = request.querystring("search_postcode") %>"
</script>
This hold the values of D3,D2,D1 and search_postcode fine but wont hold the Make and Model values.
This makes searching a pain and would be very gratefull if someone could help me fix this quite major problem.
Many many thanks in advance.:thumbsup:
I have a frustrating problem with a search page that wont hold the values entered by the user in two dynamic drop down boxes when the search is refreshed. Ive managed to hold the values of the non dynamically generated drop boxes with a combination of asp and JavaScript.
If you visit my web site http://www.wheretobuycarsfrom.com/buyacar.asp and search for a car the results page will fail to keep the value of the Make and Model you searched for.
The options for these two form fields are generated by the file http://www.wheretobuycarsfrom.com/list.js and the function fillCatagory() is called by a body onload attribute.
The form that generates the search has the dynamic selection boxes as follows with some asp to gather the values of the fields.(ive left out the other form fields so as not to clutter things up too much)
<select class="fieldmake" NAME="Make" onChange="SelectsubCat();"
<%
if request.querystring("Make") <> "" then response.write " value = """ & request.querystring("Make") & """"
%>
>
<Option>Any Make</option>
</select>
</td>
<td class="formtablecell">
<select class="fieldmodel" id="Model" NAME="Model">
<Option value="Any Model">Any Model</option>
</select>
Then at the foot of the search results page i have the following to fill the fields;
<script type="text/javascript">
drop_list.Make.value = "<% = request.querystring("Make") %>"
drop_list.Make.value = "<% = request.querystring("Model") %>"
drop_list.D3.value = "<% = request.querystring("D3") %>"
drop_list.D1.value = "<% = request.querystring("D1") %>"
drop_list.D2.value = "<% = request.querystring("D2") %>"
drop_list.search_postcode.value = "<% = request.querystring("search_postcode") %>"
</script>
This hold the values of D3,D2,D1 and search_postcode fine but wont hold the Make and Model values.
This makes searching a pain and would be very gratefull if someone could help me fix this quite major problem.
Many many thanks in advance.:thumbsup: