document.form1.login.focus(); function checkForm() { msg = new Array() if($("#login").val() == "") msg.push("Please type in a username"); if($("#pwd").val() == "") msg.push("You need to type in your password"); if (msg != "") { /*noty({ text: msg.join('
'), type: 'error', dismissQueue: true, layout: 'topRight', theme: 'defaultTheme', _timeout: 1500, });*/ bootbox.dialog({ title: 'Alert!', message: '', className: 'bootboxDanger', buttons: { ok: { label: "OK", className: 'btn-danger' } } }); return false; } else return true; } function guestLogin() { theme = $("#themeselector").val(); lang = $("#languageselector").val(); url = "../op/op.Login.php?login=guest"; if(theme) url += "&sesstheme=" + theme; if(lang) url += "&lang=" + lang; if (document.form1.referuri) { url += "&referuri=" + escape(document.form1.referuri.value); } document.location.href = url; } $(document).ready( function() { /* $('body').on('submit', '#form', function(ev){ if(checkForm()) return; ev.preventDefault(); }); */ $('body').on('click', '#guestlogin', function(ev){ ev.preventDefault(); guestLogin(); }); $("#form").validate({ invalidHandler: function(e, validator) { /*noty({ text: (validator.numberOfInvalids() == 1) ? "Required fields cannot be left blank and check for other errors in the from before adding the document.".replace('#', validator.numberOfInvalids()) : "Required fields cannot be left blank and check for other errors in the from before adding the document.".replace('#', validator.numberOfInvalids()), type: 'error', dismissQueue: true, layout: 'topRight', theme: 'defaultTheme', timeout: 1500, });*/ bootbox.dialog({ title: 'Alert!', message: (validator.numberOfInvalids() == 1) ? "Required fields cannot be left blank and check for other errors in the from before adding the document.".replace('#', validator.numberOfInvalids()) : "Required fields cannot be left blank and check for other errors in the from before adding the document.".replace('#', validator.numberOfInvalids()), className: 'bootboxDanger', buttons: { ok: { label: "OK", className: 'btn-danger' } } }); }, messages: { login: "Please type in a username", pwd: "You need to type in your password" }, }); });