title: How to make an "Edit User" form inside Bootstrap Modal using JQUERY?
body: <p>first sorry for my bad English I'm from an Spanish speaking country. 
  I'm kinda new in Web development, so I have some web project in hands and have been encountering problems with this requirement.</p>
  
  <p>In a controller index() function I need to capture an ID attribute that passes thought a link like this:</p>
  
  <pre><code>echo '&lt;td&gt;&lt;a class="btn btn-default" role="button" data-toggle="modal" href="#edituser" data-href="admin/editar/' . $usuario-&gt;id . '"&gt;&lt;i class="glyphicon glyphicon-edit"&gt;&lt;/i&gt; Editar&lt;/a&gt;&lt;/td&gt;';
  </code></pre>
  
  <p>So it can run </p>
  
  <pre><code>$data['editar_instructor'] = $this-&gt;user-&gt;obtener_datos_por_id($id);
  </code></pre>
  
  <p>and it can show the user data I'm trying to edit. I already have a JS code that captures the Modal form data and save to the DB.</p>
  
  <pre><code>//Wait until the DOM is fully loaded
  $(document).ready(function(){
      //Listen for the form submit
      $('#edituser').submit(editUser);
  });
  
  //The function that handles the process
  function editUser(event)
  {
      //Stop the form from submitting
      event.preventDefault();
  
      //Collect our form data.
      var form_data = {
          username : $("[name='username']").val(),
          password : $("[name='password']").val(),
          repassword : $("[name='repassword']").val(),
          JCCE : $("[name='JCCE']").val(),
          fullname : $("[name='fullname']").val(),
          privilegios : $("[name='privilegios']").val()
      };
      var action = $(this).attr('data-href');
      //Begin the ajax call
      $.ajax({
          url: action,
          type: "POST",
          data: form_data,
          dataType: "json",
          cache: false,
  
          success: function (json) {
              if (json.error==1)
              {
                  //Show the user the errors.
                  $('#EditUserError').html(json.message);
              } else {
                  //Hide our form
                  $('#edituserform').slideUp();
                  //Show the success message
                  $('#EditUserError').html(json.message).show();
              }
          }
      });
  }
  </code></pre>
  
  <p>that's working fine already, but I have no idea how to make the Modal load the data of an specific user.</p>
  
  <p>Any suggestion, idea, critics, etc...? I'll appreciate anything. 
  Thanks in advance!</p>