如何在按钮确定后显示表单问卷确认点击确认jquery

时间:2013-02-14 14:59:48

标签: jquery

我想在确认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-??               
                }
            });

2 个答案:

答案 0 :(得分: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();              
            }
        });

答案 1 :(得分: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;
    }
});