ClovisFilho

Untitled

Aug 23rd, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.54 KB | None | 0 0
  1.         <script type="text/javascript">
  2.             $(document).ready(function()
  3.             {
  4.                 $('#formLogin').submit(function(e)
  5.                 {
  6.                     var usuario = $('#inputUsuario').val();
  7.                     var senha   = $('#inputSenha').val();
  8.                    
  9.                     e.preventDefault();
  10.                     $.ajax
  11.                     ({
  12.                         url: 'login/entrar/',
  13.                         type: 'post',
  14.                         data: {'usuario' : usuario, 'senha' : senha},
  15.                         dataType: 'html',
  16.                         beforeSend: function() {
  17.                             if ( (usuario.length < 6) || (senha.length < 6) )
  18.                             {
  19.                                 alert('hi');
  20.                             }
  21.                         },
  22.                         success: function(retorno) {
  23.                             alert(retorno);
  24.                         }
  25.                     });
  26.                 });
  27.             });
  28.         </script>
  29.             <form id="formLogin">
  30.                 <label class="control-label" for="inputUsuario">Nome de usuário:</label>
  31.                 <input type="text" name="inputUsuario" id="inputUsuario" maxlength="16">
  32.                
  33.                 <label class="control-label" for="inputSenha">Senha de acesso:</label>
  34.                 <input type="password" name="inputSenha" id="inputSenha" maxlength="16">
  35.                
  36.                 <div class="alert alert-error" id="formErrors" style="text-align: center; font-size: 9pt; display: none;">
  37.                     <button type="button" class="close" data-dismiss="alert">×</button>
  38.                 </div>
  39.                
  40.                 <input type="submit" value="Entrar" class="btn btn-primary">
  41.                 <a href="#" class="btn" style="float: right">Recuperar senha</a>
  42.             </form>
  43.             <p style="text-align: center; font-size: 8pt; margin-top: 5px;">
  44.                 InfoNexus - Sistema de Gestão Administrativa <br />
  45.                 <a href="#">Grupo Tupi de Tecnologia e Inovação LTDA</a> <br />
  46.             </p>
  47.         </div>
  48.     </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment