From d370539def8202dd1e39ef77257f0332c00a6ab3 Mon Sep 17 00:00:00 2001 From: maru21 Date: Sat, 30 Sep 2023 17:07:29 +0300 Subject: [PATCH] started commenting parseForm --- js/9.7/parseForm.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/9.7/parseForm.js b/js/9.7/parseForm.js index aaacf94..e9552a1 100644 --- a/js/9.7/parseForm.js +++ b/js/9.7/parseForm.js @@ -61,6 +61,7 @@ function parseFormOnSubmit(returnJSON = false, parseOnly = false) { //get the complete unparsed template string from sessionstorage from loadTemplate let fullString = window.sessionStorage.getItem("fullString"); + //define output buffer let b = ""; if (objects == null) { @@ -70,13 +71,20 @@ function parseFormOnSubmit(returnJSON = false, parseOnly = false) { //iterate through templateObjects and look for according formdata for (let obj of objects) { + //compaire each obj with elements from mainFormObj for (let data of dataArray) { + //convert conList Master name to default name as set flag for appending connected list fields cl-name let conListFlag = false; + //if obj is the connected list main selector if (data.name.split("-")[0] == "clM") { + //if connected list main matches current object if (data.name.substring(4) === obj.word.replace(/ /g, "_") ) { + //set flag for next iteration of loop conListFlag = true; data.name = data.name.substring(4); + + //selection is not added to buffer if (data.value == "!none") { obj.result = ""; continue; @@ -87,6 +95,8 @@ function parseFormOnSubmit(returnJSON = false, parseOnly = false) { } } } + + //if field matches current object if (obj.word.replace(/ /g, "_") === data.name) { let value = parseDataForResult(obj, data.value); obj.result = value;