How can i know its valid in JS?
<p>I am developing an Adobe interactive form with LiveCycle LC designer with JavaScript.</p>

<p>// Identify required fields (it may be a free text field, drop-down, check box, i mean there 3 kinds possibilties) and make yellow colored them</p>

<pre><code>var myArrayYellow = new Array(); 
var yellowFields;  
yellowFields = my_required_fields_list_string.rawValue  
myArrayYellow = yellowFields.split(" "); 
for (var i = 0; i &lt; myArrayYellow.length; i++)     {
</code></pre>

<p><strong>===> Here at this point, i want to check the existence of [i] field in the form that its a valid field/objetc or not? bcz, i have chances of getting non-existing fields in the my_required_fields_list_string, hence prior to assigning yellow color to them, i want to check their validity on the form or not?</strong>  <strong>Pls. let me know the JS for this</strong>     // if its true/found, then only assign yellow color as below      </p>

<pre><code>    xfa.resolveNode("MY_ADOBE_FORM.." + myArrayYellow        [i]).ui.oneOfChild.border.fill.color.value = "255,255,254"
}; 
</code></pre>

<p>For some other purpose, some expert gave me a JS as below, i tried to tune it as per my above requirement, but its not working</p>

<pre><code>function findNodes(vNode){
    if (vNode.className === "field"){
        if (vNode.isPropertySpecified("name") === true){
            var myStateName = new RegExp(vNode.name);
            var returnValue = GFL.search(myStateName);
            if (returnValue != -1) {
                this.ui.oneOfChild.border.fill.color.value = "192,192,192";
                this.access = "readOnly";
            } else {
                this.ui.oneOfChild.border.fill.color.value = "255,255,255"; //whatever colour is open access
                this.access = "open";
            }
        }
    }
    for (var a=0;a&lt;vNode.nodes.length;a++) {
        findNodes(vNode.nodes.item(a));
    }
}
findNodes(xfa.form);
</code></pre>
