A jQuery plugin to complement jquery-form, making ajax and working with forms as effortless as possible.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
README.textile
jquery.jaxy.js

README.textile

jquery-jaxy

What is it?

A jQuery plugin to complement jquery-form, making ajax and working with forms as effortless as possible.

Dependencies

Methods

jaxy

Tells links and forms to make their request via ajax. It assumes the response to be executable JavaScript.

Note that multipart forms are given an additional “format” field set to “js” so that server applications (such as Rails) can respond with JavaScript if desired. The JS response will need to be wrapped in a textarea to be evaluated.

submitOnClick

Tells a link (or any other element) to submit a form when clicked (sometimes you just don’t want a submit button). If the link has a target attribute, it will be used as the selector to find the form to submit. Otherwise, the containing form will be submitted.

submitOnChange

Tells a select box (or any other element) to submit a form when changed. If the element has a target attribute, it will be used as the selector to find the form to submit. Otherwise, the containing form will be submitted.

val

This built-in jQuery method has been enhanced to set multiple values in a form. When used on a form it accepts an object and uses the name/value pairs to find and set values in the form.

Recommended Usage


  $('a.ajax, form.ajax').jaxy();
  $('a.submit').submitOnClick();
  $('select.submit').submitOnChange();
  $('#some_form').val({peanut_butter: 'jQuery', jelly: 'Rails'});

bonus points for using jquery-always


  $('a.ajax, form.ajax').always().jaxy();
  $('a.submit').always().submitOnClick();
  $('select.submit').always().submitOnChange();