@@ -616,7 +616,7 @@ | |||||
"bold": 0, | "bold": 0, | ||||
"collapsible": 0, | "collapsible": 0, | ||||
"columns": 0, | "columns": 0, | ||||
"description": "Message to be displayed on successful completion", | |||||
"description": "Message to be displayed on successful completion (only for Guest users)", | |||||
"fieldname": "success_message", | "fieldname": "success_message", | ||||
"fieldtype": "Text", | "fieldtype": "Text", | ||||
"hidden": 0, | "hidden": 0, | ||||
@@ -646,7 +646,7 @@ | |||||
"bold": 0, | "bold": 0, | ||||
"collapsible": 0, | "collapsible": 0, | ||||
"columns": 0, | "columns": 0, | ||||
"description": "Go to this url after completing the form.", | |||||
"description": "Go to this URL after completing the form (only for Guest users)", | |||||
"fieldname": "success_url", | "fieldname": "success_url", | ||||
"fieldtype": "Data", | "fieldtype": "Data", | ||||
"hidden": 0, | "hidden": 0, | ||||
@@ -1177,7 +1177,7 @@ | |||||
"issingle": 0, | "issingle": 0, | ||||
"istable": 0, | "istable": 0, | ||||
"max_attachments": 0, | "max_attachments": 0, | ||||
"modified": "2017-05-15 18:00:12.750448", | |||||
"modified": "2017-09-13 18:55:07.031224", | |||||
"modified_by": "Administrator", | "modified_by": "Administrator", | ||||
"module": "Website", | "module": "Website", | ||||
"name": "Web Form", | "name": "Web Form", | ||||
@@ -280,10 +280,14 @@ frappe.ready(function() { | |||||
callback: function(data) { | callback: function(data) { | ||||
if(!data.exc) { | if(!data.exc) { | ||||
frappe.doc_name = data.message; | frappe.doc_name = data.message; | ||||
$form.addClass("hide"); | |||||
$(".comments, .introduction, .page-head").addClass("hide"); | |||||
scroll(0, 0); | |||||
set_message(frappe.success_link, true); | |||||
if(!frappe.login_required) { | |||||
show_sucess_message() | |||||
} | |||||
if(frappe.is_new && frappe.login_required) { | |||||
// reload page (with ID) | |||||
window.location.href = window.location.pathname + "?name=" + frappe.doc_name; | |||||
} | |||||
if(for_payment && data.message) { | if(for_payment && data.message) { | ||||
// redirect to payment | // redirect to payment | ||||
@@ -300,6 +304,13 @@ frappe.ready(function() { | |||||
return true; | return true; | ||||
} | } | ||||
function show_sucess_message() { | |||||
$form.addClass("hide"); | |||||
$(".comments, .introduction, .page-head").addClass("hide"); | |||||
scroll(0, 0); | |||||
set_message(frappe.success_link, true); | |||||
} | |||||
function show_mandatory_missing() { | function show_mandatory_missing() { | ||||
var text = [], last_section = null; | var text = [], last_section = null; | ||||
frappe.mandatory_missing.forEach(function(d) { | frappe.mandatory_missing.forEach(function(d) { | ||||