Observe_field inside of a form?


#1

Hi I’ve just started experimenting with AJAX in Rails and have come
across this issue.

I’m trying to set up some ajax form validation on a login form. I set
up an observe_field method for the username field but the action for
the containing form is being called and rendered instead of the
action I specify in the observe_field method.

All of the observe_field examples I’ve found are done using a single
input tag, no containing form…is this the issue or is it something
else I’m missing?

<%= form_tag %>

Please Log In

Username: <%= text_field("member", "username", "class" => "text required", "id" => "username") %>

<%= end_form_tag %>

<%= observe_field :username, :frequency => 0.5, :update
=> :username_verify, :url => { :action => :verify_username } %>