title: update using modal of bootstrap in codeigniter
body: <p>I have a problem when updating the password of student, I am using the modal of bootstrap: -> here is the picture <a href="http://i.stack.imgur.com/LVo85.png" rel="nofollow">updatepassword</a></p>
  
  <p>here is my modal and the action is studentpasswordupdate/updatepasswordstudent, I retrieve the value using echo $Password in session</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;div class="modal fade" id="myModal" role="dialog"&gt;
      &lt;div class="modal-dialog modal-lg"&gt;
        &lt;div class="modal-content"&gt;
          &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
            &lt;h4 class="modal-title text-center"&gt;Change Password&lt;/h4&gt;
          &lt;/div&gt;
            &lt;div class="modal-body"&gt;&lt;br&gt;
         
             &lt;form  action="&lt;?php echo site_url("studentpasswordupdate/updatepasswordstudent") ?&gt;" method="POST"&gt;
           
                 &lt;div class="l"&gt;
                     &lt;label class=" input-lg" style="font-size: 28px;"&gt;Password:&lt;/label&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;input  class="k" type="text" name="Password" value="&lt;?php echo $Password ?&gt;" &gt;                        
           
                 &lt;/div&gt;
                 &lt;br&gt; &lt;br&gt;&lt;br&gt;
    
      &lt;div class="modal-footer"&gt;    
      &lt;button type="submit" name="Submit" class="btn btn-info m" &gt;Save&lt;/button&gt;
                  &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
          &lt;/div&gt;
                         &lt;/form&gt;
     
          
          
     
     
    
          &lt;/div&gt;
         
           
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and here is my controller/method:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class Studentpasswordupdate extends CI_Controller {
      //put your code here
      function updatepasswordstudent(){
         
         $id = $this-&gt;input-&gt;post('Id');
              
            $data= array(
              'Password' =&gt; $this-&gt;input-&gt;post('Password')
                   ); 
             
              $this-&gt;db-&gt;where('Id', $id);
              $this-&gt;db-&gt;update('studentinformation',$data);
              $hasError = $this-&gt;db-&gt;_error_message();
              
              echo $hasError;
            redirect('studentform/index', 'refresh');
          }
      
  
  }</code></pre>
  </div>
  </div>
  </p>