title: Client side validation not working for hidden field in asp.net mvc 3
body: <p>I have got a hidden field with a validation for it as below</p>
  
  <pre><code>@Html.HiddenFor(m =&gt; m.Rating)
  @Html.ValidationMessageFor(m =&gt; m.Rating)
  </code></pre>
  
  <p>The <code>Rating</code> property has <code>Range</code> validator attribute applied with range being 1-5. This is put inside a form with a submit button.</p>
  
  <p>I have then got following jquery that sets the value in hidden field on some user event (Basically user clicks on some stars to rate)</p>
  
  <pre><code>$(".star").click(function(){
      $("#Rating").val(2);
  });
  </code></pre>
  
  <p>Now if I submit the form without the user event that sets the hidden field, the validation works. The error messages is displayed properly and it works all client side.</p>
  
  <p>Now, in this situation, if I click on stars, that invokes the above javascript a sets the hidden field, the validation error message would not go away. I can submit the form after the hidden variable has some valid value. But I'm expecting that the client side validation should work. (When the hidden variable has been set with some valid value, the validation error should go away)</p>
  
  <p>Initially I thought, the jquery validation would be invoked on some special events so I tried raising click, change, keyup, blur and focusout events myself as below</p>
  
  <pre><code>$(".star").click(function(){
      $("#Rating").val(2);
      $("#Rating").change();
  });
  </code></pre>
  
  <p>But this is still not working. The error messages once appeared, does not go away at all.</p>