Developer forum

Forum » Development » Search filters as a select box?

Search filters as a select box?


Reply
I had successfully implemented search filters using input tags, like in the "ProductsFieldFilter.html" example and get the filter to work.

http://dali.net.dynamicweb.dk/en-US/test-prod-catalog.aspx

But I need to use a select box instead of input tags, and thats where something goes wrong.

My code:


       
   

   

Any help would be really appreciated!



Replies

 
Reply
Hello,

You can use the following template for your "Product field value" filter to render a drop-down list:

<select name="pf">        
    <option value="<!--@Ecom:Filters.ProductFields.Row.Value-->"
      <!--@If Defined(Ecom:Filters.ProductFields.Row.Checked)-->
        selected="true"
      <!--EndIf(Ecom:Filters.ProductFields.Row.Checked)-->>
        <!--@Ecom:Filters.ProductFields.Row.Text 
        <span>(<!--@Ecom:Filters.ProductFields.Row.TotalFormatted-->)</span>
    </option>
</select>


Note that I've hardcoded the name of the drop-down list ("pf") instead of using the tag <!--@Filters:Current.TagName-->. This is because of the bug (that will be fixed as soon as possible) in this particular filter.

Hope this will help you.

-- Pavel
 
Reply
Hi Pavel

It took me a while to figure it out, but it works now!!

Thank you much!

 

You must be logged in to post in the forum