Click here to Skip to main content
15,911,786 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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;
}
}


Problem is this code is not working in Mozilla-Firefox.

Can You help me
Posted
Updated 31-Mar-11 21:14pm
v2
Comments
Raj.rcr 1-Apr-11 1:06am    
Have u tried in other browsers? Is it working fine??

 
Share this answer
 
Comments
Raj.rcr 1-Apr-11 1:25am    
good link.. My 5
Rachit Barjatya 1-Apr-11 2:23am    
thanks but prompts line is giving Undifined error..........
Thanks for your reply.
I have done it by using


C#
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;
            }
 
Share this answer
 
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;


This code is working file in my browser. So give it a try.

BR//
Harsha
 
Share this answer
 
Comments
Rachit Barjatya 1-Apr-11 2:24am    
same problem is there. it is not working in Firefox

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900