I found my mistake. I thought that I was returning the correct
boolean values back to the form from the JS function, but I was not.
Everything is working perfectly now.
On May 25, 2:44 pm, namwob
<ebow...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I am using the following validation prototype-based js library:
>
> http://tetlaw.id.au/view/javascript/really-easy-field-validation
>
> What I am trying to do is upon submitting a form via AJAX, I want it
> to meet the conditions of the validation of the function validateMe()
>
> If it passes, go ahead and continue and push the form information via
> an AJAX call. This is what I have:
>
> <% form_remote_tag :update=>''nothing'',
> :url=> {:action => ''create''},
> :condition =>''validateMe();'',
> :html=> {:id=>''signIn''},
> :success =>''Modalbox.hide();'' do %>
>
> so the HTML that is generated is:
>
> <form id="signIn" onsubmit="if (validateMe()) { new
> Ajax.Updater(''nothing'', ''/fc/create'',
{asynchronous:true,
> evalScripts:true, onSuccess:function(request){Modalbox.hide();},
> parameters:Form.serialize(this)}); }; return false;"
method="post"
> action="/fc/create">
>
> The validateMe() function works correctly and returns FALSE if it is
> not validated,HOWEVER, if it returns TRUE, the AJAX.updater, does NOT
> get called.
>
> Am I understanding what :condition does? If I were to take
> out :condition, the form works correctly but this skips the validateMe
> function.
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---