Forum: Ruby on Rails how to use the observe_field to get more than one field?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E38118c6d20b4544e424fd700571e090?d=identicon&s=25 sreekanth.G (Guest)
on 2008-12-22 08:58
(Received via mailing list)
Hi,

I have two selctdropdown  boxes name like "resolution" and "codecname".

Now i am able to get the single field value either from resolution or
codecformat select box.
ex:
observe_field 'resolution'
or
observe_field 'codecforamt'

is there any way to get the two fields in to the observe_field method ?

Can anyone give me suggestionfs or ideas on this?

thanks
Srikanth
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2008-12-23 04:23
(Received via mailing list)
On Sun, Dec 21, 2008 at 11:58 PM, sreekanth. G <gsirikanth@gmail.com>
wrote:

> I have two selctdropdown  boxes name like "resolution" and "codecname".
>
> Now i am able to get the single field value either from resolution or
> codecformat select box.

> is there any way to get the two fields in to the observe_field method ?

Have you read the docs for the :with option? Seems like it should be
just what you need:

"A JavaScript expression specifying the parameters for the
XMLHttpRequest..."

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2008-12-23 13:49
sreekanth.G wrote:
> Hi,
>
> I have two selctdropdown  boxes name like "resolution" and "codecname".
>
> Now i am able to get the single field value either from resolution or
> codecformat select box.
> ex:
> observe_field 'resolution'
> or
> observe_field 'codecforamt'
>
> is there any way to get the two fields in to the observe_field method ?

Have you looked at the observe_form method. I think you use this if you
want to observe multiple fields in a form. I could be wrong, but at
least take a look at it.
This topic is locked and can not be replied to.