Select tag and onClick event

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Select tag and onClick event

BrunoBB
Hi All,

I have a select tag (combo) with names that represent attributes of some type (string, integer, date,..).

Each time an user selects an attribute i want to display 2 inputs if the type is Integer or Date (to search by ranges) and one input if it is a String (search for equal).

But the following onClick code is not working:

html select id: 'searchFields';
        onClick: ((html scriptaculous updater)  id: 'foo';
                                                triggerFormElement: 'searchFields';
                                                callback: [:e | self showRanges: e]);
        list: (collection at: 1) definition searchFields;
        callback: [:value | selectedSearchField := value];
        selected: selectedSearchField.

But when i select a list item nothing happend.

From seaside list i have the following, and my code is the same as the seside list:

http://forum.world.st/OnClick-on-an-quot-html-select-quot-not-working-for-me-in-Seaside-3-0-td3806061.html#a3806652

Any idea what i'm doing wrong ? I also tryed with: onChange event but with no luck.

Regards,
Bruno
Reply | Threaded
Open this post in threaded view
|

Re: Select tag and onClick event

BrunoBB
Hi All,

Finally succeed with:

html select id: 'searchFields';
                list: (collection at: 1) definition searchFields;
                callback: [:value | selectedSearchField := value];
                selected: selectedSearchField;
                onChange: 'submit()'.

This cause the page render again and we can apply the hidden class.

Regards,
Bruno