1 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 * @fileoverview JavaScript functions used on tbl_select.php
6 * @requires js/functions.js
10 * Ajax event handlers for this page
12 * Actions ajaxified here:
15 $(document).ready(function() {
18 * Set a parameter for all Ajax queries made on this page. Don't let the
19 * web server serve cached pages
26 * Ajax event handler for Table Search
28 * @uses PMA_ajaxShowMessage()
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" />');
44 $.post($search_form.attr('action'), $search_form.serialize(), function(response) {
45 if (typeof response == 'string') {
47 $("#searchresults").html(response);
49 // error message (zero rows)
50 $("#searchresults").html(response['message']);
54 }, 'top.frame_content'); // end $(document).ready()