Dear all
I am writing a program that use observe_field to listen 1 field. The
code is as follow:
  <form name="sform" action=""
style="display:inline;">
  <label for="item_name">Filter on Application Code  :
</label>
  <%= text_field_tag(''appcode'',
params[''appcode''], :size => 10 ) %>
  </form>
  <%= observe_field ''app_code'',
           :frequency => 2,
           :update => ''table'',
           :url => {:action => :index},
           :with => ''appcode'' %>
I would like to enhance this to listen more than 1 fields, I try below
code
  <form name="sform" action=""
style="display:inline;">
  <label for="item_name">Filter on Hospital Code  :
</label>
  <%= text_field_tag(''hospcode'',
params[''hospcode''], :size => 10 ) %>
<br>
  <label for="item_name">Filter on Application Code  :
</label>
  <%= text_field_tag(''appcode'',
params[''appcode''], :size => 10 ) %>
  </form>
  <%= observe_field ''appcode'',
           :frequency => 2,
           :update => ''table'',
           :url => {:action => :index},
           :with => ''appcode'' %>
  <%= observe_field ''hospcode'',
           :frequency => 2,
           :update => ''table'',
           :url => {:action => :index},
           :with => ''hospcode'' %>
It seems not a clever approach, could you give me some hint on that?
Thank you very much.
Valentino
-- 
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On 20 Nov 2008, at 09:07, Valentino Lun wrote:> > Dear all > > I would like to enhance this to listen more than 1 fields, I try below > code > > <form name="sform" action="" style="display:inline;"> > <label for="item_name">Filter on Hospital Code : </label> > <%= text_field_tag(''hospcode'', params[''hospcode''], :size => 10 ) %> > <br> > <label for="item_name">Filter on Application Code : </label> > <%= text_field_tag(''appcode'', params[''appcode''], :size => 10 ) %> > </form> > > <%= observe_field ''appcode'', > :frequency => 2, > :update => ''table'', > :url => {:action => :index}, > :with => ''appcode'' %> > > <%= observe_field ''hospcode'', > :frequency => 2, > :update => ''table'', > :url => {:action => :index}, > :with => ''hospcode'' %> > > It seems not a clever approach, could you give me some hint on that? >observe_form ? Fred> Thank you very much. > > Valentino > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 20 Nov 2008, at 09:07, Valentino Lun wrote: > >> <label for="item_name">Filter on Application Code : </label> >> :frequency => 2, >> :update => ''table'', >> :url => {:action => :index}, >> :with => ''hospcode'' %> >> >> It seems not a clever approach, could you give me some hint on that? >> > observe_form ? > > FredHello I tried below code, but seems not working.. <%= observe_form ''sform'', :frequency => 2, :update => ''table'', :url => {:action => :index}, :submit => ''sform'' %> Please help. Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 20 Nov 2008, at 09:21, Valentino Lun wrote:> > Frederick Cheung wrote: >> On 20 Nov 2008, at 09:07, Valentino Lun wrote: >> >>> <label for="item_name">Filter on Application Code : </label> >>> :frequency => 2, >>> :update => ''table'', >>> :url => {:action => :index}, >>> :with => ''hospcode'' %> >>> >>> It seems not a clever approach, could you give me some hint on that? >>> >> observe_form ? >> >> Fred > > Hello > > I tried below code, but seems not working.. > > <%= observe_form ''sform'', > :frequency => 2, > :update => ''table'', > :url => {:action => :index}, > :submit => ''sform'' %> >Define not working. (but as a guess, your form doesn''t have an id) Fred> Please help. Thanks > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 20 Nov 2008, at 09:21, Valentino Lun wrote: > >>>> It seems not a clever approach, could you give me some hint on that? >> :frequency => 2, >> :update => ''table'', >> :url => {:action => :index}, >> :submit => ''sform'' %> >> > > Define not working. (but as a guess, your form doesn''t have an id) > > FredThank for your help. The problem is solved. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---