From 47bdb4c61b08ff234a867cf10ce0e1f7588f9cf9 Mon Sep 17 00:00:00 2001 From: Marco Antonio Nina Date: Mon, 9 Jul 2012 10:09:58 -0400 Subject: [PATCH] BUG 9406 The JavaScript function saveAndRedirectForm() saves the...SOLVED - Not routed correctly. - was validate the routed to http y https --- gulliver/js/form/core/form.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gulliver/js/form/core/form.js b/gulliver/js/form/core/form.js index a8fb891df..1268e503c 100755 --- a/gulliver/js/form/core/form.js +++ b/gulliver/js/form/core/form.js @@ -3054,12 +3054,10 @@ var saveForm = function(oObject) { **/ var validateURL = function (url){ - //var regexp = /https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?/; - if (regexp.test('https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?')){ + var regexp = /http?s?:\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?/; + if (regexp.test(url)) { return true; - } - else - { + } else { return false; } }; @@ -3081,8 +3079,12 @@ var validateURL = function (url){ var saveAndRedirectForm = function(oObject, oLocation) { saveForm(oObject); - if (validateURL(oLocation)){ - document.location.href = oLocation; + if (validateURL(oLocation)) { + if (typeof(parent) != "undefined") { + parent.location.href = oLocation; + } else { + document.location.href = oLocation; + } } };