Modified it to support the Ajax action on tbl_addfield.php
[phpmyadmin/ninadsp.git] / js / db_search.js
blobae186716cbdb36dc7f143aaac8dcff3873ed45a7
1 /**
2  * @fileoverview    JavaScript functions used on Database Search page
3  * @name            Database Search
4  *
5  * @requires    jQuery
6  * @requires    js/functions.js
7  */
9 /**
10  * AJAX script for the Database Search page.
11  *
12  * Actions ajaxified here:
13  * Retrieve result of SQL query
14  */
16 $(document).ready(function() {
18     /**
19      * Set a parameter for all Ajax queries made on this page.  Don't let the
20      * web server serve cached pages
21      */
22     $.ajaxSetup({
23         cache: 'false'
24     });
26     /**
27      * Ajax Event handler for retrieving the result of an SQL Query
28      *
29      * @uses    PMA_ajaxShowMessage()
30      */
31     $("#db_search_form").live('submit', function(event) {
32         event.preventDefault();
34         PMA_ajaxShowMessage(PMA_messages['strSearching']);
36         $(this).append('<input type="hidden" name="ajax_request" value="true"');
38         $.get($(this).attr('action'), $(this).serialize() + "&submit_search=" + $("#buttonGo").val(), function(data) {
39             PMA_ajaxShowMessage('');
40             $("#searchresults").html(data);
41         }) // end $.get()
42     })
43 }, 'top.frame_content'); // end $(document).ready()