title: calculate and auto update the percentage based on number of fields filled in jquery
body: <p>I have a form with 5 fields</p>
  
  <pre><code>    &lt;form&gt;
     First name: &lt;input type="text" name="firstname" required&gt;&lt;br&gt;
     Last name: &lt;input type="text" name="lastname" required&gt;
     Age: &lt;input type="text" name="age" required&gt;
     Gender: &lt;input type="text" name="gender" required&gt;
     City: &lt;input type="text" name="city" required&gt;
     Locality: &lt;input type="text" name="locality"&gt;
     Address: &lt;input type="text" name="address"&gt;
     &lt;/form&gt;
  </code></pre>
  
  <p>When the form fields are entered based upon the number of fields filled how can I show the number of fields entered as <code>percentage completed</code> like we see in some social sites. Here only first name, last name, age, gender, city are mandatory i.e, required, locality and address are not mandatory, hence it must take 5 fields into count and Like if 2 fields are entered it must show 40% completed as when 5 fields make 100%, 2 fields make 40%</p>