Conditional Ajax for change password form

This commit is contained in:
Marc Delisle
2011-02-02 12:59:02 -05:00
parent f80b603a54
commit 7b73bd180c
2 changed files with 3 additions and 2 deletions

View File

@@ -2007,8 +2007,9 @@ $(document).ready(function() {
* Attach Ajax event handler for Change Password form submission
*
* @uses PMA_ajaxShowMessage()
* @see $cfg['AjaxEnable']
*/
$("#change_password_form").find('input[name=change_pw]').live('click', function(event) {
$("#change_password_form.ajax").find('input[name=change_pw]').live('click', function(event) {
event.preventDefault();
/**

View File

@@ -19,7 +19,7 @@ $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5)
// Displays the form
?>
<form method="post" id="change_password_form" action="<?php echo $GLOBALS['PMA_PHP_SELF']; ?>" name="chgPassword" onsubmit="return checkPassword(this)">
<form method="post" id="change_password_form" action="<?php echo $GLOBALS['PMA_PHP_SELF']; ?>" name="chgPassword" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'class="ajax" ' : ''); ?> onsubmit="return checkPassword(this)">
<?php echo PMA_generate_common_hidden_inputs();
if (strpos($GLOBALS['PMA_PHP_SELF'], 'server_privileges') !== false) {
echo '<input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n"