Conditional Ajax on SQL query form

This commit is contained in:
Marc Delisle
2011-01-28 12:47:19 -05:00
parent 2f751fbf94
commit e0c0d21380
2 changed files with 7 additions and 2 deletions

View File

@@ -208,10 +208,11 @@ $(document).ready(function() {
* Ajax Event handler for 'SQL Query Submit'
*
* @see PMA_ajaxShowMessage()
* @see $cfg['AjaxEnable']
* @memberOf jQuery
* @name sqlqueryform_submit
*/
$("#sqlqueryform").live('submit', function(event) {
$("#sqlqueryform.ajax").live('submit', function(event) {
event.preventDefault();
// remove any div containing a previous error message
$('.error').remove();

View File

@@ -115,7 +115,11 @@ function PMA_sqlQueryForm($query = true, $display_tab = false, $delimiter = ';')
return checkSqlQuery(this)">
<?php
} else {
echo '<form method="post" action="import.php" ' . $enctype . ' id="sqlqueryform"'
echo '<form method="post" action="import.php" ' . $enctype;
if ($GLOBALS['cfg']['AjaxEnable']) {
echo ' class="ajax"';
}
echo ' id="sqlqueryform"'
.' onsubmit="return checkSqlQuery(this)" name="sqlform">' . "\n";
}