仍然工作在我的mainEFT.jsp,我是想补充一点,检查用户是否希望在命令行中没有进入的价值观和选择所有记录的确认框。如果他们点击“确定”,那么它应该处理所有记录。如果他们点击“取消”,他们会收到另一条消息并返回到命令行。下面是里面的代码“文件)。就绪(功能)”部分:问题确认框呼叫JSP
$("#searchEFT").mousedown(function()
{
var Cmd_Sched_Number = document.getElementById("CMDScheduleNumber").value;
var Cmd_Contract_Year = document.getElementById("CMDContractYear").value;
var Cmd_Status = document.getElementById("CMDSchedStatus").value;
var Cmd_Creation_Date = document.getElementById("CMDCreationDate").value;
if (Cmd_Sched_Number == "")
{
if (Cmd_Contract_Year != "") {
alert("Schedule Number and EFT Contract Year must be both populated");
return false;
}
}
else if (Cmd_Contract_Year == "")
{
alert("Schedule Number and EFT Contract year must be both populated");
return false;
}
if (Cmd_Status == " " && Cmd_Creation_Date == "" &&
Cmd_Sched_Number == "" && Cmd_Contract_Year == "")
{
if (confirm("Are you sure you want to pull all EFT schedule numbers?") == false)
{
alert("Please enter information in any of the command line fields") ;
return false ;
}
else
{
return true ;
}
}
});
这里是调用EFTscreen.java程序按钮的代码:当我点击
<button id="searchEFT" type="submit" formaction="EFTscreen?action=searchEFT"
class="btn smBtn">Search</button>
确定该程序不会进入我的EFTscreen.java程序并继续处理。这是使用确认框停止处理或其他问题的问题吗?我想我需要回报但不确定。当我有任何这些字段中的数据时,我正在访问我的EFTscreen.java程序。
谢谢
我修改了代码,把“返回false”或“返回true”,并似乎没有做太多。我猜我必须对按钮做些事情,但不知道。 – hammerva