Select submitOnChange

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

Select submitOnChange

Bernat Romagosa
Hi list,

I'm sorry about my recent spamming, I'm just starting here...

I'd like an action to be triggered when an option is selected in a dropdown box, here's what I'm trying:

^ [: html | 
html form build: [:form |
form select build: [:select | 
self languages do: [:each | 
select option text: each; 
action: [Transcript show: 'whatever']
]
]
]
]

But it doesn't work, I also tried sending onSelectDo to both the option and the select, without luck. What's the proper way to do this?

Thanks!

Bernat Romagosa.
Reply | Threaded
Open this post in threaded view
|

Re: Select submitOnChange

Nicolas Petton
Hi,

You can use #beSubmitOnChange on all form elements.
Note that you can submit on any event with #beSubmitOnEvent:.

HTH,
Nico

Le lundi 28 février 2011 à 13:18 +0100, AxiNat a écrit :

> Hi list,
>
>
> I'm sorry about my recent spamming, I'm just starting here...
>
>
> I'd like an action to be triggered when an option is selected in a
> dropdown box, here's what I'm trying:
>
>
> ^ [: html |
> html form build: [:form |
> form select build: [:select |
> self languages do: [:each |
> select option text: each;
> action: [Transcript show: 'whatever']
> ]
> ]
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ]
> ]
>
>
> But it doesn't work, I also tried sending onSelectDo to both the
> option and the select, without luck. What's the proper way to do this?
>
>
> Thanks!
>
>
> Bernat Romagosa.


Reply | Threaded
Open this post in threaded view
|

Re: Select submitOnChange

Bernat Romagosa
Thanks again Nico :)

2011/2/28 Nicolas Petton <[hidden email]>
Hi,

You can use #beSubmitOnChange on all form elements.
Note that you can submit on any event with #beSubmitOnEvent:.

HTH,
Nico

Le lundi 28 février 2011 à 13:18 +0100, AxiNat a écrit :
> Hi list,
>
>
> I'm sorry about my recent spamming, I'm just starting here...
>
>
> I'd like an action to be triggered when an option is selected in a
> dropdown box, here's what I'm trying:
>
>
> ^ [: html |
> html form build: [:form |
> form select build: [:select |
> self languages do: [:each |
> select option text: each;
> action: [Transcript show: 'whatever']
> ]
> ]
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ]
> ]
>
>
> But it doesn't work, I also tried sending onSelectDo to both the
> option and the select, without luck. What's the proper way to do this?
>
>
> Thanks!
>
>
> Bernat Romagosa.