AJAXForms plugin for DOMAssistant

March 5th, 2008 by Robert Nyman

With the advent of DOMAssistant 2.6, a new world with plugins opened up. Time to release the first one: AJAXForms.

The idea with the AJAXForms plugin is to be able to post a form through AJAX, without having to post the entire web page. It also supports setting a validation function before the submission, and an optional function handling the response once the post has been completed.

How to use it

It is very simple to enable the AJAXForms plugin functionality. Simply add the class “ajax-form” to any form you would like to be submitted via AJAX. For example:

<form action="some-url.php" class="ajax-form">

Setting validation function

There are three ways you can specify what validation function to be called before the form gets posted:

Alternative 1

// Applies to the form with an id of "form-id" in the web page
$("#form-id").setBeforeSubmissionHandler(functionToCall);

Alternative 2

// Applies to all AJAXForms in the web page
DOMAssistant.AJAXForms.setBeforeSubmissionHandler(functionToCall);

Alternative 3

<!--
	Using an extra class value on the form itself.
	Replace functionToCall with desired function name.
-->
<form action="some-url.php" class="ajax-form before-handler-functionToCall">

Setting function to handle the response

Just as with validation, there are three options to set what function to call once the posting has been completed:

Alternative 1

// Applies to the form with an id of "form-id" in the web page
$("#form-id").setResponseHandler(functionToCall);

Alternative 2

// Applies to all AJAXForms in the web page
DOMAssistant.AJAXForms.setResponseHandler(functionToCall);

Alternative 3

<!--
	Using an extra class value on the form itself.
	Replace functionToCall with desired function name.
-->
<form action="some-url.php" class="ajax-form response-handler-functionToCall">

Downloading the AJAXForms plugin

You can downlod the AJAXForms plugin for DOMAssistant from the AJAXForms plugin project site.

18 Responses to “AJAXForms plugin for DOMAssistant”

  1. [...] first plugin has now been released, and it’s an AJAXForm s plugin. It offers you a way to submit a form completely through AJAX without doing any postbacks of the [...]

  2. Antanida says:

    Thanks! gut text

  3. UnicimiEmully says:

    Hi all!

    As newly registered user i just wanted to say hello to everyone else who uses this bbs 8-)

  4. effismica says:

    fix viagra joining

  5. mnorgovudkka says:

    Hy my name is mnorgovudkka
    Im from mongolia
    Buy

  6. gakinvili says:

    Aloha guys!

    I’m a newbie here.

    So i’d like to ask you if someone of you or your frineds was fired because of a financial crisis?

  7. osobo says:

    Новый способ давления на кандидата на пост Главы г. Химки

    Новый способ “наказать” тех, кто посмел участвовать в выборной кампании не на стороне действующей власти изобрели правоохранительные органы г.о. Химки.
    Руководствуясь не нормой закона, а чьей-то “волей” сотрудники милиции решили “проверить” все фирмы, внесшие денежные средства в избирательный фонд неудобных кандидатов.
    Начались “проверки” с телефонных звонков – где директор, сколько человек работает на фирме. После чего последовали “письма счастья” с просьбой предоставить всю бухгалтерскую документацию, учредительные документы фирмы, и даже, план экспликации БТИ.
    Такие запросы химкинским фирмам рассылает 1 отдел Оперативно-розыскной части № 9 Управления по налоговым преступлениям ГУВД Московской области за подписью начальника подполковника милиции Д.В. Языкова.
    И всё это в то время, когда Президент дал прямое указание правоохранительным органам о прекращении всех незаконных проверок малого и среднего бизнеса. С это целью внесены изменения в Федеральный закон “О милиции” – из статьи 11 этого закона исключены пункты 25 и 35, на основании которых ранее правоохранительные органы имели право проверять финансово-хозяйственную деятельность предприятий.
    Видно, об изменениях действующего законодательства местные правоохранительные органы не уведомлены. И не смотрят телепередачи с выступлениями Президента.
    Может быть, эта публикация подвигнет их к исполнению указаний Президента, а также к изучению и соблюдению действующего законодательства

  8. TeemFielm says:

    Hey forum members

    I just became a member of this forum

    Great work by the admin, mods and seriously every member around.

    A few days ago I read that there is a treatment for diabetes on http://www.healthcaredaily.org
    Can diabetes seriously be cured? The website http://www.healthcaredaily.org looks legit

    Could you someone tell me if this healthcare information is for real?

    Thanks a lot

    TeemFielm

  9. ticsAltecttef says:

    Работаю менеджером. Хочу сделать интернет магазин. Порекомендуйте человека или организацию, кто поможет мне в этом. Главное чтоб человек, который его делает был адекватный и недорого.

  10. нeвecтa says:

    Жесть :) Надо пост использовать в корыстных целях. Просто обязательно!

  11. Да уж, это на самом деле непросто. :)

  12. There is visibly a bundle to realize about this. I consider you made certain good points in features also.

  13. Ldggvnbb says:

    Have you got a current driving licence? best nude lollies photos rvyi

  14. I and my friends have already been looking at the excellent hints found on your web site and then at once I had a terrible suspicion I never thanked the site owner for them. The ladies were so happy to read through them and have in effect definitely been having fun with them. Appreciate your turning out to be really accommodating as well as for opting for certain incredible resources most people are really wanting to understand about. My very own honest apologies for not saying thanks to you earlier.

  15. Emile Batt says:

    Thanks for this information .I bookmarked your website

Leave a Reply