Translation update done using Pootle.
[phpmyadmin/crack.git] / js / tbl_select.js
blob47d1246910fd165e4159b363328616c53873a82a
1 /* vim: set expandtab sw=4 ts=4 sts=4: */
2 /**
3  * @fileoverview JavaScript functions used on tbl_select.php
4  *
5  * @requires    jQuery
6  * @requires    js/functions.js
7  */
9 /**
10  * Ajax event handlers for this page
11  *
12  * Actions ajaxified here:
13  * Table Search
14  */
15 $(document).ready(function() {
17     /**
18      * Set a parameter for all Ajax queries made on this page.  Don't let the
19      * web server serve cached pages
20      */
21     $.ajaxSetup({
22         cache: 'false'
23     });
25     /**
26      * Ajax event handler for Table Search
27      * 
28      * @uses    PMA_ajaxShowMessage()
29      */
30     $("#tbl_search_form").live('submit', function(event) {
31         // jQuery object to reuse
32         $search_form = $(this);
33         event.preventDefault();
35         // empty previous search results while we are waiting for new results
36         $("#searchresults").empty();
37         PMA_ajaxShowMessage(PMA_messages['strSearching']);
39             // add this hidden field just once 
40             if (! $search_form.find('input:hidden').is('#ajax_request_hidden')) {
41                 $search_form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
42             }
44         $.post($search_form.attr('action'), $search_form.serialize(), function(response) {
45             if (typeof response == 'string') {
46                 // found results
47                 $("#searchresults").html(response);
48             } else {
49                 // error message (zero rows)
50                 $("#searchresults").html(response['message']);
51             }
52         })
53     })
54 }, 'top.frame_content'); // end $(document).ready()