如何在确认jquery中单击“确定”按钮后显示表单问题
我想在确认jquery中单击“确定”按钮后显示表单问题。谢谢如何在确认jquery中单击“确定”按钮后显示表单问题,jquery,Jquery,我想在确认jquery中单击“确定”按钮后显示表单问题。谢谢 $("input[value='Close']").click(function () { var ValidComment = document.getElementById('comment_update').value; if (ValidComment == '') { $("#ErrorUpdate").text("Com
$("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-??
}
});
我认为这应该有效,但我无法测试:
$("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();
}
});
这也行
$("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;
}
});
返回后,您不能在函数内执行任何其他操作,因为控件已返回,该函数内的任何其他操作都不会执行。请看一看。希望这有帮助。@raminomrani为什么这会有帮助?@Blazemonger,因为我认为Citra的目标是更改html内容(在本例中,显示表单)。尽管Citra的函数定义序列错误。重新设计函数算法后,html()函数将有所帮助。将整个函数包装在
$(function(){})中代码>