Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hi,

I have a dropdown form used for filtering products in couchcart.

The form is displayed on site using
Code: Select all
        <cms:input
            type="dropdown"
            opt_values='No Preference=- | Option1=1 | Option2=2'
            opt_selected='-'
            name="option"
        />


Followed by a submit button.

How can I add javascript like
Code: Select all
<select onchange="this.form.submit()">
    ...
</select>

to the dropdown to make it automatically filter on selection of an option and removing the need to have a submit button?

Many thanks
You can add the onchange attribute to the cms:input definition; Couch will faithfully output it.
Hi,

Thanks for the reply, could you please explain more?

Where & how would I add it?

I should have mentioned that I have the IQ of a lemon and still get very confused easily when trying new stuff with Couch :)
Sorry, I can be quite terse. See below:
Code: Select all
<cms:input
    name = 'option'
    onchange = 'this.form.submit();'
    opt_selected = '-'
    opt_values = 'No Preference=- | Option1=1 | Option2=2'
    type = 'dropdown'
/>
Got it,

I was adding the <select> tags before

Thanks for the help :)
5 posts Page 1 of 1