observe_form not working.

Discussion relating to version 1.3.x and 1.4.x

observe_form not working.

Postby nwbrd » Fri Nov 02, 2012 3:28 pm

Hello All,

I am using observe_form() to track field values change on my page. In the same page I replaces some portion with ajax call which includes many form fields. After this replacement if I change any value from these fields, the observe_form call is not execute.

Any clue in this regard will be appreciated.

Regards,
NwBrd.
nwbrd
Junior Member
 
Posts: 8
Joined: Mon Jun 11, 2012 4:03 pm

Re: observe_form not working.

Postby mrugendrabhure » Mon Dec 03, 2012 1:07 pm

Hi,

Well, when you update the content, the JavaScript change event binding is lost. I am not user if you have given time in the observe_form method, adding it might work since giving time value runs it at a specified time and not on the "change" event.

Other way could be to copy and paste the javascript code generated into the Ajax Complete event so that the binding is re-established.

Hope this helps...
mrugendrabhure
Member
 
Posts: 38
Joined: Fri Dec 04, 2009 11:15 am
Location: INDIA

Re: observe_form not working.

Postby smugford » Wed Jan 30, 2013 7:10 pm

is there JavaScript in the template/form that you are calling?

Try to make an alert box with hello world in it on page one.

test it.

use your observe_field

test your alert again.

if your alert does not work it's ALL your javascript not working not just observe_field

Not sure if that's it but it's a easy test to eliminate a javascript errror/conflict as the issue
User avatar
smugford
Faithful Member
 
Posts: 245
Joined: Sun Nov 29, 2009 8:32 pm


Return to symfony 1.3 and 1.4

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests