Guest User

Untitled

a guest
Apr 9th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.            
  3.             var methods = {  
  4.                 forms : function(){
  5.                     var login = function(){
  6.                         //$('input[type="submit"]').trigger('click');
  7.                         var user = $(this).children('form').children('input[type="text"]').val();
  8.                         var pass = $(this).children('form').children('input[type="password"]').val();
  9.                         if(user.length < 1 || pass.length < 1){
  10.                             alert('Invalid!\nPlease fill all required forms');
  11.                         } else {
  12.                             alert('username: '+user+'\npassword: '+pass);
  13.                             $.registar('hide');
  14.                         }
  15.                     }
  16.                    
  17.                     $.registar('show', {
  18.                         icon        : '',
  19.                         width       : '320px',
  20.                         content     : '<h4>Registar</h4>'
  21.                                     + '<form action="" method="GET">'
  22.                                     +     '<input placeholder="username" name="user" type="text"/'+'>'
  23.                                     +     '<input placeholder="password" name="pass" type="password"/'+'>'
  24.                                     +     '<input type="submit" style="display:none" / >'
  25.                                     + '</form>',
  26.                         buttons : {
  27.                             button1 : {text: 'Registar', onclick: login},
  28.                             button4 : {text: 'Cancelar'}
  29.                         }
  30.                     });
  31.                 }
Add Comment
Please, Sign In to add comment