title: Jquery Validation + Globalization + applied to all numeric fields instead of just the ones that is required
body: <p>I am trying to build an application in asp .net mvc3 for India. I have used jQuery globalization to validate numbers in the Indian format.</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>&lt;script src="@Url.Content("~/Scripts/jquery.globalize/globalize.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.globalize/cultures/globalize.culture.hi-IN.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $.validator.methods.number = function (value, element) {
          return !isNaN(Globalize.parseFloat(value));
      }
  
      $(document).ready(function () {
          Globalize.culture('hi-IN');
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>This is based on the following SO question:</p>
  
  <p><a href="https://stackoverflow.com/questions/5199835/mvc-3-jquery-validation-globalizing-of-number-decimal-field">MVC 3 jQuery Validation/globalizing of number/decimal field</a></p>
  
  <p>It works perfectly. However, there are 2 new bugs because of this code:</p>
  
  <p>1) I have two input fields Area and SuperBuiltUpArea - Area is Required field and SuperBuiltUpArea is not. jQuery validation does not let me submit the form as it does not accept null(empty) entry for the SuperBuiltUpArea field and throw an error that the field should be a number.</p>
  
  <p><strong><em>Edit:</em></strong> This issue has been resolved by replacing the validator statement to</p>
  
  <pre><code>this.optional(element) || !isNaN(Globalize.parseFloat(value));
  </code></pre>
  
  <p>2) If I type alphabets in these field, jQuery validation does not fire up. It however does not let me submit the form. But this is very confusing as the form shows no error but would not submit.</p>
  
  <p>Any help would be grateful.</p>
  
  <p>Thanks</p>