title: Automatically increment input type="hidden" value
body: <p>I have this line of code</p>
  
  <pre><code>        &lt;html&gt;
          &lt;head&gt;&lt;/head&gt;
          &lt;body&gt;
          &lt;script&gt;
  $(document).ready(function(){
  $("#update").click(function(){
  $("#id2").css("display","hidden");
  var r = $("#id2").val()+1;
  $("#id2").val(r);
  });
  });
  &lt;/script&gt;
          &lt;title&gt;CV Education Form&lt;/title&gt;
         .
         .
         .
         .
          &lt;/fieldset&gt;
          &lt;input type="text" name="id" id="id2" value="&lt;?php echo ($id == 0 ? 1 : $id );?&gt;"/&gt;
          &lt;input type="submit" value="Update" name="submit"/&gt;
          &lt;/form&gt;
          &lt;/body&gt;
          &lt;/html&gt;
  </code></pre>
  
  <p>and I want to change it to hidden so it is invisble but also when i click on a button update (which I have it) then it increments the value (<strong>$id</strong>) ... More simple i want something like that id+1.</p>
  
  <p>Do you know how can I do that?</p>
  
  <p><img src="https://i.stack.imgur.com/UBOhx.png" alt="enter image description here"></p>
  
  <p>When I click on update button i want the 1 which is the $id to become $id+1 but I dont want to add myself I want to do it automatically when i click the update button and also hide the textfield</p>