Javascript ASP.NET在确认窗口中有一个文本字段,并使用必需的字段检查
我在ASP.NET中单击按钮时显示确认窗口,我在C#中执行此操作,如下所示Javascript ASP.NET在确认窗口中有一个文本字段,并使用必需的字段检查,javascript,c#,jquery,asp.net,Javascript,C#,Jquery,Asp.net,我在ASP.NET中单击按钮时显示确认窗口,我在C#中执行此操作,如下所示 ScriptManager.RegisterStartupScript(this, typeof(string), "confirm", "ConfirmAccept();", true); function ConfirmAccept() { if (confirm("Do you confirm to add this entry?")) { var clickButton = docume
ScriptManager.RegisterStartupScript(this, typeof(string), "confirm", "ConfirmAccept();", true);
function ConfirmAccept() {
if (confirm("Do you confirm to add this entry?")) {
var clickButton = document.getElementById("<%= button_add.ClientID %>");
clickButton.click();
}
}
然后在JavaScript中调用confirm函数,如下所示
ScriptManager.RegisterStartupScript(this, typeof(string), "confirm", "ConfirmAccept();", true);
function ConfirmAccept() {
if (confirm("Do you confirm to add this entry?")) {
var clickButton = document.getElementById("<%= button_add.ClientID %>");
clickButton.click();
}
}
函数confirmacept(){
如果(确认(“您确认添加此条目吗?”)){
var clickButton=document.getElementById(“”);
单击按钮。单击();
}
}
在这里,当我点击按钮并确认框时,当我按下ok时,
按钮中的代码\u add
点击被执行。但是在这里,我想在确认窗口中显示一个文本框,我想在单击确认框上的OK之前输入一个值。单击“确定”按钮时,此字段还应具有所需的字段检查。然后单击“确定”后,我想访问按钮\u add
单击事件中此字段的值或文本。我该怎么做呢?我想你需要这个代码。。
如果你不想要这个
我很抱歉。
我的英语水平很低
.aspx