I have a form to user login:
<%= form_tag(@action, :method => \"post\", :name => \'signup\' ,:onSubmit => \'return validate();\') do %>
For what reason can you not send an ajax request from javascript code?
The best way would be to send a GET ajax request when the focus is lost. The get request could then return true or false and your javascript could then reflect this on the page.