.net中的确认框 [英] confirmation box in .net
本文介绍了.net中的确认框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我在.net中使用Javascript作为确认框.我的代码是
Hello, I am using Javascript for confirmation box in .net. My Code is
var input = document.form2.OrgFile1.value;
var lnkOrgFile1 = document.getElementById("lnkOrgFile1").innerText;
var OrgF1 = document.getElementById("OrgF1").innerText;
if (lnkOrgFile1 == "" && OrgF1 == "" && input == "") {
var r = window.confirm("Are you sure you want to Continue without Selecting Image?");
if (r == true) {
return true;
}
else {
return false;
}
}
问题是此代码在Mozilla-Firefox中不起作用.
您能帮我吗?
Problem is this code is not working in Mozilla-Firefox.
Can You help me
推荐答案
检查此 Adding_windows_and_dialogs [
感谢您的答复.
我已经使用
完成了
Thanks for your reply.
I have done it by using
var input = document.form2.OrgFile1.value; var lnkOrgFile1 = document.getElementById('lnkOrgFile1').innerHTML; var OrgF1 = document.getElementById('<%= OrgF1.ClientID %>').innerHTML; if (lnkOrgFile1 == "" && OrgF1 == "" && input == "") { var r = window.confirm("Are you sure you want to Continue without Selecting Image?"); if (r == true) { return true; } else { return false; } return false; }
而不是使用像这样的代码
Instead of using the code like this
var r = window.confirm("Are you sure you want to Continue without Selecting Image?"); if (r == true)
为什么不尝试像这样使用它?
why dont you try using it like this ??
if (confirm("Are you sure you want to Continue without Selecting Image?")==true) return true; else return false;
此代码是我的浏览器中的工作文件.因此,请尝试一下.
BR//
Harsha
This code is working file in my browser. So give it a try.
BR//
Harsha
这篇关于.net中的确认框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文