title: validate a textbox value serverside using jquery
body: <p>I have list of orders when user enter a value in textbox on blur I wanted to validate that value on serverside and then display a right or wrong icons based on true or false from server. I am using struts2, jquery. </p>
  
  <p>I am very poor in ajax so please help me answer much detailed as possible</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>UPDATE</strong> Thank you for your responses, I have tried <a href="https://stackoverflow.com/users/957500/fluidbyte">Fluidbyte</a> solution but in response I got the entire html. My entries in different places as follows.</p>
  
  <p>struts.xml</p>
  
  <pre><code>&lt;action name="validate" class="orders" method="validate"/&gt;
  </code></pre>
  
  <p>jsp</p>
  
  <pre><code>&lt;td&gt;&lt;s:textfield name="serial" id="serial" theme="simple"/&gt;&lt;/td&gt;
  &lt;td&gt;&lt;SPAN id="result"&gt;&lt;/SPAN&gt; &lt;/td&gt;
  </code></pre>
  
  <p>Action class</p>
  
  <pre><code>public String validate() {
  result = myOrdSvc.validate(value);
  return SUCCESS;
  }
  
  /**
   * @param result
   *            the result to set
   */
  public void setResult(String result) {
      this.result = result;
  }
  
  /**
   * @return the result
   */
  public String getResult() {
      return result;
  }
  </code></pre>
  
  <p>orders.js</p>
  
  <pre><code>         $('#serial').blur(function(){
              $.post('validate',{ value: $(this).val() },function(data){
                 $("#result").html(data);
              });
          });
  </code></pre>
  
  <p>The result <strong>"data"</strong> is entirely an html not just <strong>"true"</strong> or <strong>"false"</strong> which I am returning.</p>