Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu to write menu

Status
Not open for further replies.

JohnandSwifty

Technical User
Joined
May 31, 2005
Messages
192
Location
GB
Hi,

I have a drop-down on my site that has five options, once selected this populates another drop-down below it.

I want an 'all' option that passes no value to page (this for a search) yet when i specify ,"") it passes the variable as blank and i only get blank fields returned. Javascript thing or me being a muppet?

Thanks

<!--start of function-->
<script language="javascript">
<!--//
function CatMenu(CatLevel2) {
var Indx=CatLevel2;
with (document.ProductFilter.CatLevel2)
{
document.ProductFilter.CatLevel2.options.length=0;
if (Indx==0)
{
}
if (Indx==1)
{
options[0]=new Option("All","");
options[1]=new Option("Solid Wood","");
options[2]=new Option("Wood Effect","");
options[3]=new Option("Cream & White","");
options[4]=new Option("High Gloss","");
options[5]=new Option("Coloured & Distinctive","");
}

if (Indx==2)
{
options[0]=new Option("All","");
options[1]=new Option("Cooking Ranges","");
options[2]=new Option("Ovens","");
options[3]=new Option("Hobs","");
options[4]=new Option("Extractors","");
options[5]=new Option("Refridgeration","");
options[6]=new Option("Dishwashers & Laundry","");
options[7]=new Option("Other","");
}

if (Indx==3)
{
options[0]=new Option("All","");
options[1]=new Option("Laminate","");
options[2]=new Option("Solid Wood","");
options[3]=new Option("Minerelle","");
options[4]=new Option("Granite","");
}

if (Indx==4)
{
options[0]=new Option("All","");
options[1]=new Option("Stainless Steel","");
options[2]=new Option("Ceramic","");
options[3]=new Option("Composite","");
}

if (Indx==5)
{
options[0]=new Option("All","");
}

ProductFilter.CatLevel2.options[0].selected=true;
}

}
//-->
</script>
<!--end of function-->


<cfform name="ProductFilter" action="Read_Products.cfm">
<td width="32" align="right" valign="middle">Filter</td>
<td width="150" align="center" valign="middle"><cfinput type="text" name="ProductsFilter" height="22" value="#ProductsFilter#"> </td>
<td width="151" align="center" valign="middle"><cfselect name="CatLevel1" onChange="CatMenu(this.selectedIndex);" size="1">
<option value="">All</option>
<option value="Kitchens">Kitchens</option>
<option value="Appliances">Appliances</option>
<option value="Worktops">Worktops</option>
<option value="Sinks &amp; Taps">Sinks &amp; Taps</option>
<option value="Lights &amp; Handles">Lights &amp; Handles</option>
</cfselect></td>
<td width="94" align="center" valign="middle"><cfselect name="CatLevel2" size="1">
<option>All</option>
</cfselect> </td>
<td width="36" align="right" valign="middle"><cfinput type="submit" value="Go" name="submit_OrdersQuickfind"> </td>
</cfform>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top