Skip to content

Latest commit

 

History

History
executable file
·
50 lines (32 loc) · 1.08 KB

README.md

File metadata and controls

executable file
·
50 lines (32 loc) · 1.08 KB

SmartAjaxForm

Lets just send forms via AJAX and display the result. You need only to set the class to "ajaxForm" to your form-tag and it will work.

Screenshot

How to use

Get started by copy this in your head:

window.addEvent('domready', function() {
    var mySmartFormObj = new SmartAjaxForm();
});

and add the class "ajaxForm" to your form-tags:

form id="myForm" class="ajaxForm" action="demo.php" method="post"

It is important to make no cross-domain request. So use relative urls in the action attribute.

Syntax

new SmartAjaxForm([options])

Arguments

  • no Arguments

Options

  • regExpClassname: (regexp) To change the CSS class name, for example /^ajaxForm/i -> class='ajaxForm'
  • responseClass: (String) CSS class name for the response
  • loadingClass: (String) CSS class name for the loading animation

Events

  • onClick
  • onComplete
  • onFailure

Contact

Please contact me ([email protected]) if you have any suggestions or comments.