title: How to check for one JSON object being present in another
body: <p>I have two sets of data in a <strong>JSON</strong> (data.json) as below : </p>
  
  <pre><code>UP = [{"password": "jhonjhon", "username":"jhon"}, {"password": "juliejulie", "username":"julie"}, {"password": "blakeblake", "username":"blake"}];
  </code></pre>
  
  <p>And </p>
  
  <pre><code>Admins = '[{"Admin":"jhon"}, {"Admin":"julie"}]';
  </code></pre>
  
  <p>I have an <strong>HTML</strong> form which the user will use to login. </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
      &lt;form name="myForm" onsubmit="finalCheck()"&gt;
          UserName&lt;input type="text" id="uid" value="UserId"/&gt;
          UserPassword&lt;input type="password" id="pwd" value="UserPwd"/&gt;
          &lt;input type="submit"/&gt;
      &lt;/form&gt;
  &lt;/body&gt;
      &lt;script src="data.json"&gt;&lt;/script&gt;
      &lt;script src="checking.js"&gt;&lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>On the click of the submit button I want to first check if the username (stored in a var, say <code>x</code>) entered belongs to the <code>Admins</code> list in my <strong>JSON</strong> file or not. Eg: if <code>x</code> is <code>jhon</code> I want to know if the same <code>jhon</code> exists in the <code>Admins</code> of the <strong>JSON</strong>. </p>
  
  <p><strong>JavaScript</strong> as of now is  as : </p>
  
  <pre><code>function finalcheck(){
      var x = document.forms["myForm"]["uid"].value;
      var y = document.forms["myForm"]["pwd"].value;
  }
  </code></pre>
  
  <p>Help with JavaScript is much appreciated!</p>