Skip to content
Snippets Groups Projects
Commit 89a7426e authored by Falko Timme's avatar Falko Timme
Browse files

- Added optional successMessage parameter to function submitFormConfirm.

parent ecb6b3a8
No related branches found
No related tags found
No related merge requests found
...@@ -134,12 +134,14 @@ function submitForm(formname,target) { ...@@ -134,12 +134,14 @@ function submitForm(formname,target) {
} }
function submitFormConfirm(formname,target,confirmation) { function submitFormConfirm(formname,target,confirmation) {
var successMessage = arguments[3];
if(window.confirm(confirmation)) { if(window.confirm(confirmation)) {
var submitFormObj = jQuery.ajax({ type: "POST", var submitFormObj = jQuery.ajax({ type: "POST",
url: target, url: target,
data: jQuery('#'+formname).serialize(), data: jQuery('#'+formname).serialize(),
dataType: "html", dataType: "html",
success: function(data, textStatus, jqXHR) { success: function(data, textStatus, jqXHR) {
if(successMessage) alert(successMessage);
if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) { if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) {
var parts = jqXHR.responseText.split(':'); var parts = jqXHR.responseText.split(':');
//alert(parts[1]); //alert(parts[1]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment