title: validate name field with first letter capital
body: <p>I want to validate Name field with first letter capital. I am trying to do this and some how I was done it but little bit issue. Issue is all input type field are contain first word capital with my this code also email input. Here is my code:</p>
  
  <pre><code>$(document).ready(function () {
      $('input').on('keydown', function (e) {
          if (this.value == '') {
              var char = String.fromCharCode(e.which);
              if (char.match(/^\w$/)) {
                  // If is empty and we pressed a printable key...
                  this.value = char.toUpperCase();
                  return false;
              }
          }
      });
      $('#00N2800000IA6aX').on('change', function () {
          if ($(this).val() == 'India') {
              $('#mobile').attr("maxlength", 10);
              //set phone value null if you want
              $('#mobile').val("");
              //set phone value 10 digits and remove rest if you want
              $('#mobile').val($('#mobile').val().substr(0, 10));
          } else {
              $('#mobile').removeAttr("maxlength");
          }
      });
      if ($('#00N2800000IA6aX option:selected').val() == 'India') {
          $('#00N2800000IA6aX').trigger('change');
      }
      $("#abc").click(function () {
          var first_name = $('#first_name').val();
          var email = $("#email").val();
          var mobile = $("#mobile").val();
          $("#returnmessage").empty(); // To empty previous error/success message.
          // Checking for blank fields.
          if (email == '' || mobile == '') {
              $("#returnmessage").append("&lt;span&gt;Enter Your Name, Vaild E-mail &amp; Mobile No.   &lt;span&gt;");
              return false;
          }
          // To Check Empty Form Fields.
          if (first_name.length == 0) {
              $('#head').text("* All fields are mandatory *"); // This Segment Displays The Validation Rule For All Fields
              $("#first_name");
              return false;
          }
          // Validating Name Field.
          if (!first_name.match(name_regex) || first_name.length == 0) {
              $('#first_name').text("* For your name please use alphabets only *");
              //This Segment Displays The Validation Rule For Name
              $("#first_name").focus();
              return false;
          }
          var mailPattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]                {2,4})+$/;
          if (!mailPattern.test(email)) {
              $("#returnmessage").append("&lt;span&gt;Enter Your Valid Email Address!&lt;span&gt;");
              return false;
          }
          if ($('#00N2800000IA6aX option:selected').val() == 'India') {
              var phoneNumberPattern = /^[0-9]{10}$/;
              if (!phoneNumberPattern.test(mobile)) {
                  $("#returnmessage").append("&lt;span&gt;Enter Your 10 Digits Mobile No Only.&lt;span&gt;");
                  return false;
              }
          }
      });
  });
  </code></pre>