<%= observe_field

hi i have one more Q its abt
<%= observe_field

it is doing ajax post back when i check and uncheck the check box but
its passing the value when i check the check box but not when i uncheck
it,is there any way we could make it work so that it always sends
value,i need this as i cant use 'check_box_tag ’ as i need to call a
javascript code too as far as i know with ‘check_box_tag’ we cant call
javascript and the remote function with it if we can please let me
know…or please let me know how we can make observe field to return the
value when the checkbox is unchecked too

Thanks

you need to use hidden field with the same name before the check box. if
the check box is checked it should override the value of the hidden
field in the params hash . else the hidden field value will be taken.
the rails helpers do this for you and do support means of including the
javascript event attributes. see the api

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs