title: Showing errors validation on bootrap modal
body: <p>I´ve got a modal boostrap. I want to show the error of validation on boostrap modal. But I`ve several difficults for make it</p>
  
  <p>My modal</p>
  
  <pre><code>&lt;!-- Modal --&gt;
          &lt;div class="modal fade" id="box-modal" tabindex="-1" role="dialog" aria-labelledby="myModal" aria-hidden="true"&gt;
              &lt;div class="modal-dialog"&gt;
                  &lt;div class="modal-content"&gt;
                      &lt;div class="modal-header"&gt;
                          &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                          &lt;h4 class="modal-title"&gt;&lt;!-- Aqui va el titulo de la pagina modal --&gt;@yield('modal_title')&lt;/h4&gt;
                      &lt;/div&gt;
                      &lt;div class="modal-body"&gt;
                           @yield('modal_body')
                          &lt;div class="alert hidden" id="modal-alert"&gt;&lt;/div&gt;
                          &lt;!--Aqui va el cuerpo de la página modal --&gt;
  
  
                      &lt;/div&gt;
                      &lt;div class="modal-footer"&gt;
                      &lt;!-- Aquí va el pie de la pagina modal --&gt;
                      @yield('modal_footer')
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;!-- Fin de Modal --&gt;
  </code></pre>
  
  <p>I show a form on the body of the modal</p>
  
  <pre><code> {{ Form::open(array('id' =&gt;'formuser-create', 'role' =&gt; 'form', 'class' =&gt; 'form-horizontal')) }}
              &lt;div class="form-group"&gt;
                  {{ Form::label('inputuser', 'Nombre de usuario', array('class' =&gt; 'col-md-4 control-label')) }}
                  &lt;div class="col-md-5"&gt;
                      {{ Form::text('inputuser','', array('placeholder' =&gt; 'Introduce la contraseña...', 'class' =&gt; 'form-control input-md')) }}   
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  {{ Form::label('inputpassword', 'Contraseña', array('class' =&gt; 'col-md-4 control-label')) }}
                  &lt;div class="col-md-5"&gt;
                      {{ Form::password('inputpassword','', array('placeholder' =&gt; 'Introduce la contraseña...', 'class' =&gt; 'form-control input-md')) }}
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  {{ Form::label('inputpassword1', 'Confirmar constraseña', array('class' =&gt; 'col-md-4 control-label')) }}
                  &lt;div class="col-md-5"&gt;
                      {{ Form::password('inputpassword1','', array('placeholder' =&gt; 'Vuelve a introducir la contraseña...', 'class' =&gt; 'form-control input-md')) }}
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  {{ Form::label('inputemail', 'Email', array('class' =&gt; 'col-md-4 control-label')) }}
                  &lt;div class="col-md-5"&gt;
                      {{ Form::text('inputemail','', array('placeholder' =&gt; 'Introduce el email...', 'class' =&gt; 'form-control input-md')) }} 
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  {{ Form::label('es_admin', '¿Es administrador?', array('class' =&gt; 'col-md-4 control-label')) }}
                  &lt;div class="col-md-5"&gt;
                      {{ Form::checkbox('es_admin','1') }}
                  &lt;/div&gt;
              &lt;/div&gt;
  
  @stop
  @section('modal_footer')
  &lt;div class='form-group text-center' id='editor-actions'&gt;
      {{ Form::submit('Guardar', ['class' =&gt; 'btn btn-success']) }} 
      {{ Form::reset('Limpiar', ['class' =&gt; 'btn btn-primary']) }}
      {{ Form::close() }}  
  &lt;/div&gt;
  </code></pre>
  
  <p>My controller  </p>
  
  <pre><code>//Rutas del sistema
  Route::Controller('users','UsersController');
  </code></pre>
  
  <p>method Create for add users</p>
  
  <pre><code>//metodo para agregar al usuario
      public function postCreate()
      {
          //validamos reglas inputs
          $rules = array(
            'inputuser' =&gt; 'required|max:10',
            'inputpassword' =&gt; 'required|min:8',
            'inputpassword1' =&gt; 'required|min:8',
            'inputemail' =&gt; 'required|email|unique:users,email'
          );
  
          $validation = Validator::make(Input::all(), $rules);
          //Si no pasa la validacion
          if($validation-&gt;fails())
          {
              //Obtenemos los mensajes de error de la validation
              $messages = $validation-&gt;messages();
              //Redireccionamos a nuestro formulario de atras con los errores de la validación 
              if(Request::ajax())
              {
                  return Response::json(array('errors' =&gt; $messages));
              }
              else
              {
                  return Redirect::back()-&gt;withInput()-&gt;withErrors($validation);
              }
          }
          //Si todo ha ido bien guardamos
          $password = Input::get('inputpassword');
          $user = new User;
          $user-&gt;username = Input::get('inputuser');
          $user-&gt;password = Hash::make($password);
          $user-&gt;email = Input::get('inputemail'); 
          $user-&gt;admin = (Input::get('es_admin') == '1') ? 1 : 0;
  
          //guardamos
          $user-&gt;save();
  
          //redirigimos a usuarios
  
          return Redirect::to('admin/users.index')-&gt;with('status','ok_create');
  
      }
  </code></pre>
  
  <p>My main.js javascript file where I call with ajax to my method of the controller. And returned me a json response.</p>
  
  <pre><code>$("document").ready(function()
  {
     $("#formuser-create").submit(function()
     {
        event.preventDefault();
        var form = $(this);
        $.ajax({
           url: 'users/create',
           dataType:'json',
           data: form.serialize(),
           type: "POST", 
           success: function(response)
           {
               if(response.success)
               {
                   alert("ok!");
               }
               else(response.error)
               {
                   alert(response['errors']);
               }
           },
           error: function(xhr, textStatus, thrownError)
           {
               console.log(xhr.status);
               console.log(thrownError);
               console.log(textStatus);
           }
        });
     }); 
  });
  </code></pre>
  
  <p>My json that get when the fails validation</p>
  
  <pre><code>{"errors":{"inputuser":["The inputuser field is required."],"inputpassword":["The inputpassword field is required."],"inputpassword1":["The inputpassword1 field is required."],"inputemail":["The inputemail field is required."]}}
  </code></pre>
  
  <p>How Could I show the errors in my form modal. I´m one little confunsed to show it.</p>