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