You might have to use the :frequency option to observe_field. If you
are modifying the field with javascript it might not cause the browser
to through the event''s which is how the default observe function works
without a frequency option. I ran into this problem with submitting a
form through javascript and it wasn''t catching my onSubmit handler
event to cancel it and do a ajax call. But try it with the frequency
option.
On Oct 12, 12:21 pm, Kad Kerforn
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> In a form, I need to observe a value in ahidden field (this value is
> calculated by a javascript function and written in a hidden field)
> the value is calculated .. written (I can display it ..) but no change
> is detected by my observer...
> why ? how can detect it ?
>
> here is my partial .rhtml view
>
> <input id="startdate" name="startdate"
value="" style="display:none"
> size="10"/> # result
>
> <a id="_startdate_link" href="#"
>
onclick="DatePicker.toggleDatePicker(''startdate'')"
> class="selectInput"><%=
booking_date(@booking.start_at) %></a> #
> link calling the function
> <div id="_startdate_calendar" class="date_picker"
> style="display:none"></div> # calendar pop-up
>
> <%= observe_field (''startdate'', :url => {:action
=>
> ''startdate_selected''}, :with =>
"''id=''+value") -%>
>
> thansk for your help
>
> --
> Posted viahttp://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
-~----------~----~----~----~------~----~------~--~---