From cd43199f1a14b43102809f33a07d96b930af280d Mon Sep 17 00:00:00 2001 From: Harold Thetiot Date: Thu, 5 Jan 2017 20:34:52 -0800 Subject: [PATCH] fix Privacy policy and End user license agreement #2 --- js/appdfeditor.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/js/appdfeditor.js b/js/appdfeditor.js index 637d1e2..c0d416f 100644 --- a/js/appdfeditor.js +++ b/js/appdfeditor.js @@ -1635,10 +1635,11 @@ var appdfEditor = (function() { //privacy policy validation var $privacyPolicyArr = $("input[id^=\"description-texts-privacypolicy-link\"]"); + var $privacyPolicyTextArr = $("textarea[id^=\"description-texts-privacypolicy-data\"]"); totalErrorCheckCount += $privacyPolicyArr.size(); - $privacyPolicyArr.each(function() { - var linkValue = $(this).val(); - var fullTextValue = $(this).next().next().val(); + $privacyPolicyArr.each(function(index) { + var linkValue = $($privacyPolicyArr[index]).val(); + var fullTextValue = $($privacyPolicyTextArr[index]).val(); if ((linkValue !== "" && fullTextValue === "") || (linkValue === "" && fullTextValue !== "")) { checkErrorMessage({ valid: false, @@ -1652,10 +1653,11 @@ var appdfEditor = (function() { //eula validation var $eulaArr = $("input[id^=\"description-texts-eula-link\"]"); + var $eulaTextArr = $("textarea[id^=\"description-texts-eula-data\"]"); totalErrorCheckCount += $eulaArr.size(); - $eulaArr.each(function() { - var linkValue = $(this).val(); - var fullTextValue = $(this).next().next().val(); + $eulaArr.each(function(index) { + var linkValue = $($eulaArr[index]).val(); + var fullTextValue = $($eulaTextArr[index]).val(); if ((linkValue !== "" && fullTextValue === "") || (linkValue === "" && fullTextValue !== "")) { checkErrorMessage({ valid: false,