i've got first app jquery coming along, , i've got both dialog boxes built , executing should be, , login box comes when click login (in file menu), can't open box come when click open.
here's jquery code both dialogs:
$("#login-form").dialog({ autoopen: false, height: 350, width: 350, modal: true, buttons: { "log in": function () { var bvalid = true; allfields.removeclass("ui-state-error"); bvalid = bvalid && checklength(username, "username", 3, 16); bvalid = bvalid && checklength(password, "password", 5, 16); bvalid = bvalid && checkregexp(username, /^[a-z]([0-9a-z_])+$/i, "username may consist of a-z, 0-9, underscores, begin letter."); bvalid = bvalid && checkregexp(password, /^([0-9a-za-z])+$/, "password may consist of : a-z 0-9"); if (bvalid) { if (username.val() == "admin" && password.val() == "password") { $("#users tbody").append("<tr>" + "<td>" + username.val() + "</td>" + "<td>" + password.val() + "</td>" + "</tr>"); $(this).dialog("close"); } else { alert("invalid username/password combo"); } } }, cancel: function () { $(this).dialog("close"); } }, close: function () { allfields.val("").removeclass("ui-state-error"); } }); $("#dateturn-form").dialog({ autoopen: false, height: 550, width: 350, modal: true, buttons: { "accept": function () { $("#content-left").append("<p>date: " + dateinput.val() + " turn: " + turnvalue + "</p>"); $(this).dialog("close"); }, cancel: function () { $(this).dialog("close"); } } }); $("#login") .click(function () { $("#login-form").dialog("open"); }); $("#open") .click(function () { $("dateturn-form").dialog("open"); });
and here's jsfiddle link project: http://jsfiddle.net/chbrn/1/ reason, said above, clicking open button won't launch project.
Comments
Post a Comment