Conditional Ajax on table Search

This commit is contained in:
Marc Delisle
2011-01-25 07:26:54 -05:00
parent 6ca2a7bef3
commit 2064f09f42
2 changed files with 3 additions and 2 deletions

View File

@@ -48,9 +48,10 @@ $(document).ready(function() {
/** /**
* Ajax event handler for Table Search * Ajax event handler for Table Search
* *
* (see $GLOBALS['cfg']['AjaxEnable'])
* @uses PMA_ajaxShowMessage() * @uses PMA_ajaxShowMessage()
*/ */
$("#tbl_search_form").live('submit', function(event) { $("#tbl_search_form.ajax").live('submit', function(event) {
// jQuery object to reuse // jQuery object to reuse
$search_form = $(this); $search_form = $(this);
event.preventDefault(); event.preventDefault();

View File

@@ -98,7 +98,7 @@ if (!isset($param) || $param[0] == '') {
// foreign keys from innodb) // foreign keys from innodb)
$foreigners = PMA_getForeigners($db, $table); $foreigners = PMA_getForeigners($db, $table);
?> ?>
<form method="post" action="tbl_select.php" name="insertForm" id="tbl_search_form"> <form method="post" action="tbl_select.php" name="insertForm" id="tbl_search_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : ''); ?>>
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?> <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
<input type="hidden" name="goto" value="<?php echo $goto; ?>" /> <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="hidden" name="back" value="tbl_select.php" /> <input type="hidden" name="back" value="tbl_select.php" />