title: value is not set after the form is submitted
body: <p>I m trying to insert user's check in value into db. For this i call the function and set the hidden field's value and than trying to submit the form but here after the form is submiteed hiden field's value is reset .</p>
  
  <p>HTML Code</p>
  
  <pre><code>&lt;form name="checkinout" action="logindetails.php" method="post" enctype="multipart/form-data" id="checkinout"&gt;
  &lt;table class="login-detaills" width="100%"&gt;&lt;thead&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;Check In&lt;/th&gt;&lt;th&gt;Check Out&lt;/th&gt;&lt;th&gt;Hours&lt;/th&gt;&lt;/thead&gt;
  &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/fieldset&gt;
  &lt;table&gt;
  &lt;tr&gt;&lt;td&gt;&lt;input type="button"  onClick="call()" value="checkin"&gt;&lt;/button&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="button" id="logout" onclick="call2();" value="Check Out" &gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;input type="hidden" id="checkin" name="checkin"&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="hidden" id="checkout" name="checkout"&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>function call(){
  $('#checkin').val("checkin");
  $('#checkinout').submit();
  }
  function call2(){
  $('#checkout').val("checkout"); 
  $('#checkinout').submit();
  }
  </code></pre>
  
  <p>PHP CODE</p>
  
  <pre><code> if(isset($_POST['checkinout']) ){
      if(isset($_POST['checkin']) &amp;&amp; $_POST['checkin']=='checkin'){
      $sql = "INSERT INTO attend (loginout,log_type,fk_userid) VALUES ('".TODAY_DATETIME."','I','".$_SEESION['user_id']."')";     
  }elseif(isset($_POST['checkout']) &amp;&amp; $_POST['checkout']=='checkout'){
      $sql = "INSERT INTO attend (loginout,log_type,fk_userid) VALUES ('".TODAY_DATETIME."','O','".$_SEESION['user_id']."')";     
  
  }   
  $stmt = $class-&gt;dbh-&gt;prepare($sql);
  $stmt-&gt;execute();
  $res = $stmt-&gt;fetch(PDO::FETCH_ASSOC);
  }
  </code></pre>
  
  <p>first of all its not satisfied this if(isset($_POST['checkinout']) </p>