From 3b1de37e5433a86b52cece64676e660b7ba60d79 Mon Sep 17 00:00:00 2001 From: Keshav Nangare Date: Mon, 27 Aug 2018 22:38:07 +0530 Subject: [PATCH 1/5] Added form validaton in teamengine. --- teamengine-web/src/main/webapp/test.jsp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/teamengine-web/src/main/webapp/test.jsp b/teamengine-web/src/main/webapp/test.jsp index c6a647360..f961f893b 100644 --- a/teamengine-web/src/main/webapp/test.jsp +++ b/teamengine-web/src/main/webapp/test.jsp @@ -168,7 +168,22 @@ if (mode.equals("retest") || mode.equals("resume") || mode.equals("cache")) { window.location = url + "&stop=" + stop + "&t=" + d.getTime(); } - + + From 414e3566481a6fa3e8c6e7e509a2e42242194fbb Mon Sep 17 00:00:00 2001 From: Keshav Nangare Date: Wed, 29 Aug 2018 16:42:43 +0530 Subject: [PATCH 2/5] Added validation methond in single script element. --- teamengine-web/src/main/webapp/test.jsp | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/teamengine-web/src/main/webapp/test.jsp b/teamengine-web/src/main/webapp/test.jsp index f961f893b..edaa7b80e 100644 --- a/teamengine-web/src/main/webapp/test.jsp +++ b/teamengine-web/src/main/webapp/test.jsp @@ -22,6 +22,7 @@ Executing Tests + - From c7e58afdc6266169d85bdb8ca500f329250bb5a4 Mon Sep 17 00:00:00 2001 From: Keshav Nangare Date: Fri, 21 Dec 2018 15:09:43 +0530 Subject: [PATCH 3/5] Updated the form validation method with ID's parameter submited by the ets. --- teamengine-web/src/main/webapp/test.jsp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/teamengine-web/src/main/webapp/test.jsp b/teamengine-web/src/main/webapp/test.jsp index edaa7b80e..a91493d58 100644 --- a/teamengine-web/src/main/webapp/test.jsp +++ b/teamengine-web/src/main/webapp/test.jsp @@ -169,19 +169,27 @@ if (mode.equals("retest") || mode.equals("resume") || mode.equals("cache")) { window.location = url + "&stop=" + stop + "&t=" + d.getTime(); } - function validation() { - var iuturi = window.frames[1].window.document.forms[0].elements.iut_uri.value; - var iutdoc = window.frames[1].window.document.forms[0].elements.iut_doc.value; + // Validate the inputs. + function validateIutInputs(iut_uri, iut_doc) { + var iuturi = window.frames[1].window.document.getElementById(iut_uri).value; + var iutdoc = window.frames[1].window.document.getElementById(iut_doc).value; if ((iutdoc == undefined || iutdoc == null || iutdoc == "") && (iuturi == undefined || iuturi == null || iuturi == "")) { - alert("Capability URL or document is empty."); - window.frames[1].window.document.forms[0].elements.iut_uri.focus(); + alert("Capability URL or document should not be empty."); + window.frames[1].window.document.getElementById(iut_uri).focus(); return false; } - if (iutdoc !== undefined && iutdoc !== null && iutdoc !== "") { - window.frames[1].window.document.forms[0].elements.iut_uri.value = ""; - } } + + // Reset iut_uri if the file is uploaded. + function resetIutValue(iut_uri, iut_doc){ + var iut_uri_value = window.frames[1].window.document.getElementById(iut_uri).value; + var iut_doc_value = window.frames[1].window.document.getElementById(iut_doc).value; + + if (iut_doc_value !== undefined && iut_doc_value !== null && iut_doc_value !== "") { + window.frames[1].window.document.getElementById(iut_uri).value = ""; + } + } From 6f163d6e05d1ca6d95249ed50942443fddfce202 Mon Sep 17 00:00:00 2001 From: Keshav Nangare Date: Thu, 25 Apr 2019 12:32:19 +0530 Subject: [PATCH 4/5] Updated the form validation. --- teamengine-web/src/main/webapp/test.jsp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teamengine-web/src/main/webapp/test.jsp b/teamengine-web/src/main/webapp/test.jsp index a91493d58..c8e04c76b 100644 --- a/teamengine-web/src/main/webapp/test.jsp +++ b/teamengine-web/src/main/webapp/test.jsp @@ -179,6 +179,10 @@ if (mode.equals("retest") || mode.equals("resume") || mode.equals("cache")) { window.frames[1].window.document.getElementById(iut_uri).focus(); return false; } + if (iutdoc != null && iutdoc != "" && iuturi != null && iuturi != "") { + alert("Provide only one input either capability URL or document!"); + return false; + } } // Reset iut_uri if the file is uploaded. From 88236d56a041da0eb4871eb591f736177b05f4b0 Mon Sep 17 00:00:00 2001 From: Keshav Nangare Date: Thu, 17 Oct 2019 14:31:45 +0530 Subject: [PATCH 5/5] Removed the resetIutValue method. --- teamengine-web/src/main/webapp/test.jsp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/teamengine-web/src/main/webapp/test.jsp b/teamengine-web/src/main/webapp/test.jsp index c8e04c76b..01651f300 100644 --- a/teamengine-web/src/main/webapp/test.jsp +++ b/teamengine-web/src/main/webapp/test.jsp @@ -184,16 +184,6 @@ if (mode.equals("retest") || mode.equals("resume") || mode.equals("cache")) { return false; } } - - // Reset iut_uri if the file is uploaded. - function resetIutValue(iut_uri, iut_doc){ - var iut_uri_value = window.frames[1].window.document.getElementById(iut_uri).value; - var iut_doc_value = window.frames[1].window.document.getElementById(iut_doc).value; - - if (iut_doc_value !== undefined && iut_doc_value !== null && iut_doc_value !== "") { - window.frames[1].window.document.getElementById(iut_uri).value = ""; - } - }