Click here to Skip to main content
15,506,209 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
var chkBoxList1= document.getElementById("ctl00_ContentPlaceHolder1_ChkAssignPages");


  if(chkBoxList1 != null)
  {

    var chkBoxCount1= chkBoxList1.getElementsByTagName("input");
      for(var i=0;i<chkBoxCount.length;i++)
      {
           var labelArray = checkBoxArray[i].parentNode.innerText;

            for(var n=0; n<chkBoxCount1.length; n++)
            {
                  var lblName = chkBoxCount1[n].parentNode.innerText;
                  if(lblName == labelArray)
                  {
                      alert('Already pages Assigned');
                      return false;
                  }
            }
      }
  
}

friends pls help me.
Posted
Updated 30-Nov-12 10:49am
v2
Comments
Richard C Bishop 30-Nov-12 11:14am    
I am curious about this problem. I have a question for you. Does FireFox render the element id differently than IE does? Meaning, when you use document.getElementByID("ct100_ContentPlaceHolder1_ChkAssignPages"); does FireFox have the same ID in the markup as IE does in order to find the element? Does that make sense?
joshrduncan2012 30-Nov-12 11:14am    
What is the error you are getting in Firefox? "Not working" doesn't help us. Also, can you please tag your posts with the language you are using? ASP.NET is not a language.

1 solution

I would have posted this as a comment, but I couldn't do formatting.

I don't know if this will solve your problem, but as a general thought you should not use "ctl00_ContentPlaceHolder1_ChkAssignPages" The Id could conceivably change on you, to be safe you should do something like

JavaScript
var chkBoxList1= document.getElementById("<%= ChkAssignPages.ClientID"); 


This will let .NET put the real client ID in there for you each time.
 
Share this answer
 

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