Updated the AJAX library to remove the response DIV if it is already present (to eliminate the double message scenario).
git-svn-id: http://svn.cleancode.org/svn/pickles@40 4d10bc64-7434-11dc-a737-d2d0f8310089
This commit is contained in:
parent
7667db3fec
commit
7c1b477731
1 changed files with 6 additions and 2 deletions
|
@ -81,13 +81,17 @@ function ajaxSubmit(form, customHandler, beforeOrAfter) {
|
|||
}
|
||||
else {
|
||||
var responseMessage = document.createTextNode(responseObject.message);
|
||||
|
||||
responseElement.className = responseObject.type;
|
||||
|
||||
responseElement.appendChild(responseMessage);
|
||||
}
|
||||
|
||||
if (document.getElementById('ajaxResponse') != null) {
|
||||
form.removeChild(document.getElementById('ajaxResponse'));
|
||||
}
|
||||
|
||||
responseElement.id = 'ajaxResponse';
|
||||
form.insertBefore(responseElement, (beforeOrAfter == 'before') ? form.firstChild : form.lastChild);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue