0

我想在按钮确定点击确认 jquery.thanks 后显示表单问题...

$("input[value='Close']").click(function () {
                var ValidComment = document.getElementById('comment_update').value;
                if (ValidComment == '') {
                    $("#ErrorUpdate").text("Comment is Required");                
                    return false;
                }
                else {
                    return confirm('Are you sure to close this ticket ?'); 
                    --show form here-??               
                }
            });
4

2 回答 2

2

我认为这应该可行,但我无法对其进行测试:

        $("input[value='Close']").click(function () {

            if ($("#comment_update").val() == '') {
                $("#ErrorUpdate").text("Comment is Required");                
                return false;
            }
            else {
               if (confirm('Are you sure you want to close this ticket?')) {
               //Show form code goes here
               $("#form").show();              
            }
        });
于 2013-02-14T15:03:00.687 回答
0

这也可以

$("input[value='Close']").click(function () {
    var ValidComment = document.getElementById('comment_update').value;
    if (ValidComment == '') {
        $("#ErrorUpdate").text("Comment is Required");                
        return false;
    }
    else {
        var result = confirm('Are you sure to close this ticket ?');
        if (result) {
            $("form-here").css("display", "block");
            return true;
        }
        return false;
    }
});
于 2013-02-14T15:03:40.663 回答