title: how to compare captcha session value in jquery?
body: <p>i have a form which does validation on client side by jquery,i want to compare the value of session for captcha  with the value of the input.but i dont know</p>
  
  <ol>
  <li><p>how to get the session value of captcha and     </p></li>
  <li><p>how to compare the session value and the input?</p></li>
  </ol>
  
  <p>this is how i compare the session but it makes no differnt,for both wrong and right value,it says its wrong.i get the session value via this code:</p>
  
  <pre><code> $('#captchaimg').val()
  </code></pre>
  
  <p>but off course its wrong!</p>
  
  <pre><code>if(!($('#6_letters_code').val() == $('#captchaimg').val())){
  alert('error');
  $('#6_letters_code').parent().parent().find('.form-error').html(" error");
  err++;
   }
  </code></pre>
  
  <p>and this is my captcha code:</p>
  
  <pre><code>&lt;img src="captcha_code_file.php?rand=&lt;?php echo rand(); ?&gt;" id="captchaimg" /&gt;
  </code></pre>
  
  <p>and my input box:</p>
  
  <pre><code>&lt;input id="6_letters_code" name="6_letters_code" type="text"  class="form-input"/&gt;
  </code></pre>