title: Jquery check two inputs for same value
body: <p>I've been trying to write Jquery code to check if two inputs have the same value on form submit without luck.</p>
  
  <p>If input with id "id1" has the same value as input with id "id2" alert "some text" and return false.</p>
  
  <p>Any help would be much appreciated.</p>
  
  <pre><code>$('#form').submit(function() {
      var id1 = $(#id1).text();
      var id2 = $(#id2).text();
      if (id1 == id2) {
          alert('Error, cant do that');
          return false;
      }
      else
      {
      return true;
      }
  
  });
  </code></pre>