$(function () {
    var Title = $("#Title"),
    allFields = $([])
    .add(Title)
    ;
    function ValidTemp() {
        var bValid = true;
        allFields.removeClass("ui-state-error");
        bValid = bValid && checkLength(Title, "问题标题", 1, 255);
        return bValid;
    };
    $("#formadd").submit(function () {
        if (ValidTemp()) {
            $("#AddBTN").parent().append("<img src=\"/Common/Images/loading.gif\" />提交中，请稍候...");
            $("#AddBTN").attr("disabled", "disabled");
            return true;
        } else {
            return false;
        }
    });
});