/***************************************************** filename: jquery.login.js description: contains needed functions to display login dialog and submit login form created by: kailer last modified by: kailer *****************************************************/ // login // login functions $(function(){ var usuario = $("#login_usuario"), clave = $("#login_clave"); function checkLength(o,n,min,max) { if ( o.val().length > max || o.val().length < min ) { $("#dialog4").dialog('open'); return false; } else { return true; } } $("#dialog_login_tb").click(function(){ $("#dialog3").dialog('open'); return false; }); $(".login_button").click(function(){ $("#dialog3").dialog('open'); return false; }); $("#dialog3").dialog({ bgiframe: true, autoOpen: false, open: function(){ $(".ui-widget-header").css("background","url(http://download01.regnumonlinegame.com/images/spanish/headers/login_header.png)"); $(this).css("visibility", "visible"); $('#login_usuario').focus() }, close: function(){ $(this).css("visibility", "hidden"); $("#loginForm").each(function(){this.reset();}); }, height: 195, width: 250, resizable: false, shadow: false, modal: true, buttons: { 'Login': function() { var bValid = true; bValid = bValid && checkLength(usuario,"username",2,20); bValid = bValid && checkLength(clave,"password",4,30); if (bValid) { $("#loginForm").submit(); $("#dialog3").html("
![]() Logging in... |