Question about observe_form


#1

Dear all

I am writing a program that use observe_field to listen 1 field. The
code is as follow:

Filter on Application Code : <%= text_field_tag('appcode', params['appcode'], :size => 10 ) %>

<%= 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

Filter on Hospital Code : <%= text_field_tag('hospcode', params['hospcode'], :size => 10 ) %>
Filter on Application Code : <%= text_field_tag('appcode', params['appcode'], :size => 10 ) %>

<%= 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


#2

On 20 Nov 2008, at 09:07, Valentino L. wrote:

Filter on Application Code :
: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


#3

Frederick C. wrote:

On 20 Nov 2008, at 09:07, Valentino L. wrote:

Filter on Application Code :
: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’ %>

Please help. Thanks


#4

On 20 Nov 2008, at 09:21, Valentino L. 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)

Fred


#5

Frederick C. wrote:

On 20 Nov 2008, at 09:21, Valentino L. 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)

Fred

Thank for your help. The problem is solved.