Click here to Skip to main content
13,087,235 members (55,188 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 30-Nov-12 5:00am
Updated 30-Nov-12 9:49am
richcb 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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 30 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100