Success message and redirect url should also work for 'login require' types webforms
fixes https://github.com/frappe/erpnext/issues/9073
This commit is contained in:
parent
501c19b505
commit
bb7cfda345
1 changed files with 4 additions and 12 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue