Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#dialog").dialog({
- bgiframe: true,
- autoOpen: false,
- height: 230,
- modal: true,
- buttons: {
- 'Logga in': function() {
- var name = $("#username"),
- password = $("#password"),
- allFields = $([]).add(name).add(password),
- tips = $("#vtips");
- var bValid = true;
- allFields.removeClass('ui-state-error');
- bValid = bValid && checkLength(name,"Skriv inn änvandarnamn",3,14);
- bValid = bValid && checkLength(password,"Skriv inn lösenord",5,24);
- bValid = bValid && checkRegexp(name,/^[a-zA-Z0-9\s\xc5\xc4\xd6\xe5\xe4\xf6]+$/i,"Felaktig änvandarnamn.");
- bValid = bValid && checkRegexp(password,/^[a-zA-Z0-9\s\xc5\xc4\xd6\xe5\xe4\xf6]+$/,"Felaktig lösenord");
- if (bValid) {
- $.ajax({
- url: '/interactive/',
- type: 'POST',
- data: 'username=' + name.val() + '&password=' + password.val(),
- cache: false,
- success: function (html) {
- if (html == 'ok') {
- $('#dialog').dialog('close');
- top.location.href = '/aa';
- } else {
- updateTips('Fel lösenord!');
- }
- }
- });
- }
- },
- Avbryta: function() {
- $(this).dialog('close');
- }
- },
- close: function() {
- allFields.val('').removeClass('ui-state-error');
- }
- });
Add Comment
Please, Sign In to add comment