PHP on T R A X
Rapid Application Development Made Easy

Helpers::JavascriptHelper::form_remote_tag

form_remote_tag( array $options = array() )


Description

Returns a form tag that will submit using XMLHttpRequest in the background instead of the regular reloading POST arrangement. Even though it’s using Javascript to serialize the form elements, the form submission will work just like a regular submission as viewed by the receiving side (all elements available in $_REQUEST). The options for specifying the target with "url" and defining callbacks is the same as link_to_remote.

$options is an array of key => value pairs of options refer to link_to_remote.

This method requires the inclusion of the script.aculo.us Javascript library.


Examples

<?= form_remote_tag(array(
                "url" => array(":action" => "search"), 
                "update" => "photos",
                "complete" => visual_effect("blind_down", "photos"),
                "loading" => "Element.show('spinner')",
                "loaded" => "Element.hide('spinner')")) ?>