This line: <%= observe_field "role_role",{ :function=>"just_test" }%>
will actually generate the following javascript:
new Form.Element.Observer('role_role', 1, function(element, value)
{ just_test }) // JS syntax error!
I think you wanted to do this instead
<%= observe_field "role_role",{ :function=>"just_test(value)" }%>
so it will generate this:
new Form.Element.Observer('role_role', 1, function(element, value)
{ just_test(value) })
The observe_field method wraps the JS code you specify in :function in
its own function(element, value) {}, with the same parameter names.
> --
>
> You received this message because you are subscribed to the Google
> Groups "Philippine Ruby Users Group (PRUG/PhRUG)" group.
> To post to this group, send email to
ruby...@googlegroups.com.
> To unsubscribe from this group, send email to
ruby-phil+...@googlegroups.com
> .
> For more options, visit this group at
http://groups.google.com/group/ruby-phil?hl=en
> .