Commit a0bfe5d1 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Changed the submit function to use the new pieform model for replying

to ajax posts. Corrected the blanking of the password fields
parent 5aa8aa02
......@@ -141,9 +141,9 @@ $smarty = smarty();
$smarty->assign('form', pieform($prefsform));
$smarty->assign('INLINEJAVASCRIPT', "
function clearPasswords() {
$('oldpassword').value = '';
$('password1').value = '';
$('password2').value = '';
$('accountprefs_oldpassword').value = '';
$('accountprefs_password1').value = '';
$('accountprefs_password2').value = '';
}");
$smarty->display('account/index.tpl');
......@@ -161,7 +161,7 @@ function accountprefs_validate(Pieform $form, $values) {
}
}
function accountprefs_submit($values) {
function accountprefs_submit($values, Pieform $form) {
global $USER;
db_begin();
......@@ -185,8 +185,7 @@ function accountprefs_submit($values) {
}
db_commit();
json_reply(false, get_string('prefssaved', 'account'));
exit;
$form->json_reply(PIEFORM_OK, get_string('prefssaved', 'account'));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment