Conditional Ajax on SQL query form
This commit is contained in:
@@ -208,10 +208,11 @@ $(document).ready(function() {
|
|||||||
* Ajax Event handler for 'SQL Query Submit'
|
* Ajax Event handler for 'SQL Query Submit'
|
||||||
*
|
*
|
||||||
* @see PMA_ajaxShowMessage()
|
* @see PMA_ajaxShowMessage()
|
||||||
|
* @see $cfg['AjaxEnable']
|
||||||
* @memberOf jQuery
|
* @memberOf jQuery
|
||||||
* @name sqlqueryform_submit
|
* @name sqlqueryform_submit
|
||||||
*/
|
*/
|
||||||
$("#sqlqueryform").live('submit', function(event) {
|
$("#sqlqueryform.ajax").live('submit', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// remove any div containing a previous error message
|
// remove any div containing a previous error message
|
||||||
$('.error').remove();
|
$('.error').remove();
|
||||||
|
@@ -115,7 +115,11 @@ function PMA_sqlQueryForm($query = true, $display_tab = false, $delimiter = ';')
|
|||||||
return checkSqlQuery(this)">
|
return checkSqlQuery(this)">
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} 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";
|
.' onsubmit="return checkSqlQuery(this)" name="sqlform">' . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user