Easy way to send unlimited number of forms on a page via Ajax.

The page is not reloaded when the form is submitted. This significantly increases the speed of the site.

Mootools already offers a good implementation. I have just summarized this and adapted it so that all the forms with the class “ajax form” (<form ….class=’ajaxForm’>) get assigned automatically.

More info at MootoolsForge.



Try it!

6 Comments » for SmartAjaxForm
  1. Ian N says:

    Hi BMo,

    I’m quite new to Mootools, so not completely sure about this.

    I tried the solution given to J-Luc Durand, that allows the user to close the result by clicking a link. When I tried to integrate the code above I get an error: ‘$(‘ in my Firefox error console, which dissapears after a few seconds.

    I changed the code to read: $$(‘#idofyourLink’).addEvent(‘click’,function(){ form_tag.replaces(responseLayer); });

    This worked, not sure if it’s the correct way to do it or not, can you advise?


    Ian N

    • admin says:

      oh, sorry. You are right. Use: $$(‘#idofyourLink’)
      or $(‘idofyourLink’) without the #.

      • Ian N says:

        Great, now it makes sense. It was the # character that confused me. Think I will use this method.


  2. J-Luc Durand says:

    Hello and thank you for your job.

    i use SmartAjaxForm on my web site and i have a question :

    How to close the result( by clicking a link and not wherever in the result

    (Sorry for my english)

    • admin says:

      remove the event from the response div:
      'events': {
      'click': function(){

      and integrate inside:
      onComplete: function(response) {
      $('#idofyourLink').addEvent('click',function(){ form_tag.replaces(responseLayer); });

      Best regards

  3. bot says:

    Nice plugin

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

More aboute me
Give me a +

donate my work ♥ → paypal