SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    Syracuse
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help figuring out an error

    I've got some code I inherited from a former co-worker that seems to be giving me problems. Basically, whenever any box is checked on the form on my page, I get an error that say "document.divTest3 has no properties".

    Here's an example of the code that controls the one of the select boxes:

    <Input name="<%=Chbox2%>" Type="checkbox" onclick="checkone(<%=checknoforunselectbox%>, this,<%=cint(isMember)%>);" value=RM>

    I don't know if its helpful to post the complete javascript, so just in case:

    Code:
    <SCRIPT LANGUAGE=javascript>
    <!--
    var ne, ie
    if(document.all)
    {ie=true;}
    else{ne = true;}
    
    	function PicDelete(url)
    	{
    		if(confirm("Are you sure you want to delete the picture?")) 
    		{
    			document.location.href  = url;
    			return false; 
    		}
    	}
    function checkone(uncheck, obj, flg){
    if (ne){
    refr="document.divTest3.document.activeMember";
    }
    else{refr="document.activeMember";}
      <%if arrResult(GRP_SEC_ADDREMOVE_LEADERS) then%>
      if (obj.checked == true) 
    		eval(refr + ".elements["+ uncheck +"].checked = false") ;
      <%end if%>
      }  
    function CheckOneOpt(uncheckopt){
    if (ne){
    refr="document.divTest3.document.ApplyAutoApproveMember";
    }
    else{refr="document.ApplyAutoApproveMember";}
      if (eval(refr +".elements[" + uncheckopt + "].checked == true")) 
              {
    			 eval(refr + ".elements[" + uncheckopt + "].checked = false") ;
              }
      }
    function testJoinGroupErrors()
    {
    if (ne){
    refr="document.divTest3.document.joinGroups";
    }
    else{refr="document.joinGroups";}
    	passedTest = "passed";
    	
    	isMaxLength(eval(refr + ".textareajoin.value"), 100 , "Group joining reason")
    	isHTML(eval(refr + ".textareajoin.value"), "Group joining reason");
    	
    	listErrors();
    
    	if (passedTest == "notPassed" )
    	{
    		return false;
    	}
    	else if (passedTest == "passed" )
    	{
    	return true;
    	}
    }
    function submitform(formnumber){
    if (ne){
    refr="document.divTest3.document.ApplyAutoApproveMember";
    }
    else{refr="document.ApplyAutoApproveMember";}
       //formnumber==1 if automatically approve future clicked
       //formnumber==2 if New Membership Conform Action button is Clicked 
       //formnumber==3 if New Membership Cancel button is Clicked 
       //formnumber==4 if Member List Conform Action button is Clicked 
       //formnumber==5 if Member List Cancel button is Clicked
       //formnumber==6 if Join Group  button is Clicked
       //formnumber==7 f Join Group  cancel button is Clicked 
    	if(formnumber == 1)
    	{
    		if(eval(refr + ".autoapproved.checked"))
    		{
    			eval(refr + ".leaderprocess.value=1");
    			eval(refr + ".hautoapproved.value=1");
    			
    			eval(refr + ".action='group_home_proc.asp?GroupID=" + "<%=intGroupID%>" + "&" + "GroupType=" + "<%=intGroupType%>" + "'") ;                          
    			eval(refr + ".submit()");
    			return true; 
    		}
    		else
    		{ 
    		    eval(refr + ".leaderprocess.value=1");
    		    eval(refr + ".hautoapproved.value=0");
    		    
    		    eval(refr + ".action='group_home_proc.asp?GroupID=" + "<%=intGroupID%>" + "&" + "GroupType=" + "<%=intGroupType%>" +"'") ;                         
    		    eval(refr + ".submit()");
    		    return true; 
    		}
    	}
    	if(formnumber == 2)
    	{
    	    eval(refr +".leaderprocess.value=2");
    	    eval(refr + ".action='group_home_proc.asp?GroupID=" + "<%=intGroupID%>" + "&" + "GroupType=" + "<%=intGroupType%>" + "'") ;                 
    	    eval(refr +".submit()");
    	    return true; 
    	}
       if (formnumber == 4){
    	  if (ne){
    		refr="document.divTest3.document.activeMember";}			
    		else{refr="document.activeMember";}    
    		
    	    eval(refr + ".leaderprocess.value=4");
    	    eval(refr + ".action='group_home_proc.asp?GroupID=" + "<%=intGroupID%>" + "&" + "GroupType=" + "<%=intGroupType%>" +"'");                  
    	    eval(refr + ".submit()");
    	    return true; 
    	} 
    	if (formnumber == 5){
    	    if (ne){
    		refr="document.divTest3.document.activeMember";}			
    		else{refr="document.activeMember";}    
    	    eval(refr + ".leaderprocess.value=5");  
    	    eval(refr + ".action='Groups.asp?GroupID=" + "<%=intGroupID%>" + "&" + "GroupType=" + "<%=intGroupType%>" + "'");                         
    	    eval(refr +".submit()");
    	    return true; 
    	} 
    	if (formnumber == 6){
    	       if (ne){
    		refr="document.divTest3.document.joinGroups";}			
    		else{refr="document.joinGroups";}                     
    	    if(testJoinGroupErrors())
    	    {
    	    eval(refr + ".leaderprocess.value=6") ;
    	    eval (refr + ".action='group_home_proc.asp?GroupID=" + "<%=intGroupID%>" + "&" + "GroupType=" + "<%=intGroupType%>" + "'") ;                         
    	    eval (refr + ".submit()");
    	    return true; 
    	    }
    	    else
    			return false;
    	}    
    	if (formnumber == 3){
    	     if (ne){
    		refr="document.divTest3.document.activeMember";}			
    		else{refr="document.activeMember";}            
    	    eval(refr+".leaderprocess.value=3");
    	    if (ne){
    		refr="document.divTest3.document.ApplyAutoApproveMember";}			
    		else{refr="document.ApplyAutoApproveMember";}
    	    eval(refr + ".action='Groups.asp?GroupID=" + "<%=intGroupID%>" + "&" + "GroupType=" + "<%=intGroupType%>" +"'");                         
    	    eval(refr + ".submit()");
    	    return true; 
    	}  
    	if (formnumber == 7){
    	 if (ne){
    		refr="document.divTest3.document.activeMember";}			
    		else{refr="document.activeMember";}  
    		 eval(refr+".leaderprocess.value=7");   
    		  if (ne){
    		refr="document.divTest3.document.joinGroups";}			
    		else{refr="document.joinGroups";}   
    	    eval(refr +".action='Groups.asp?GroupID=" + "<%=intGroupID%>" + "&" + "GroupType=" + "<%=intGroupType%>" +"'");            
    		eval(refr + ".submit()");
    	    return true; 
    	}          
    } 
    </SCRIPT>

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    Syracuse
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cancel that request, I cleaned up the code and its working now


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •