Merge pull request #3535 from manassolanki/web-forms

Fix for success message and redirect url in webforms
This commit is contained in:
Makarand Bauskar 2017-06-21 21:08:25 +05:30 committed by GitHub
commit b98ebddbac

View file

@ -280,19 +280,11 @@ frappe.ready(function() {
callback: function(data) {
if(!data.exc) {
frappe.doc_name = data.message;
if(!frappe.login_required) {
$form.addClass("hide");
$(".comments, .introduction, .page-head").addClass("hide");
scroll(0, 0);
set_message(frappe.success_link, true);
} else {
set_message(__('Saved'));
}
$form.addClass("hide");
$(".comments, .introduction, .page-head").addClass("hide");
scroll(0, 0);
set_message(frappe.success_link, true);
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) {
// redirect to payment
window.location.href = data.message;