Link to home
Create AccountLog in
Avatar of BILL Carlisle
BILL CarlisleFlag for United States of America

asked on

Does IE7 allow jQuery? The attached code works great in Firefox.. but not in IE 7

Hi All,
The attached code works great in Firefox.. but not in IE 7
Does IE7 allow jQuery?
What can I do to fix it?

Thank you!
function selectAll(pAction, pChkbxGrp) { 
   if(pAction=='selectAll')
      jQuery('[id^="'+pChkbxGrp+'"]').attr('checked',true);
   if(pAction=='deselectAll')
      jQuery('[id^="'+pChkbxGrp+'"]').attr('checked',false);
   if(pChkbxGrp.substring(0,2) =='CK') calcTiers();
}
function calcTiers(pID,pType){
  if(jQuery('#'+pID).attr('checked')){
    // 'P' nothing  CKXXSXXTXX
    if(pType=='S'){ //check its P
      jQuery('[id^='+pID.substring(0,7)+'T]').attr('checked',true);
      jQuery('[id='+pID.substring(0,4)+']').attr('checked',true);
    } else if(pType=='T'){ //check its P and S
      jQuery('[id='+pID.substring(0,7)+']').attr('checked',true);
      jQuery('[id='+pID.substring(0,4)+']').attr('checked',true);
    }
  } else if(!(jQuery('#'+pID).is(':checked'))){
    //alert('NOT');
    if(pType=='P'){ 
      jQuery('[id^="'+pID.substring(0,4)+'"]').attr('checked',false);
    } else if(pType=='S'){ //check its P and S
      jQuery('[id^="'+pID.substring(0,7)+'"]').attr('checked',false);
    } else if(pType=='T'){ 
      // 'T' CK01S01T02
      var lTierCnt = jQuery('[id^="'+pID.substring(0,7)+'T"]:checked').length;
      //alert(lTierCnt);
      if(lTierCnt==0){
         jQuery('[id="'+pID.substring(0,7)+'"]').attr('checked',false);
      }
    }
  }
   var concat = '';
   jQuery('[id^="CK"]:checked').each(function(index) {
      //   alert(jQuery(this).attr(id));
      var lId = jQuery(this).attr("id");
      if(lId.length == 10){ // Tier
         concat = concat +':'+ jQuery(this).val();
      } else if(lId.length == 7){ //Sub
         if(jQuery('input[id^="'+lId+'T"]').length==0){
            concat = concat +':'+ jQuery(this).val();
         }
      } else if(lId.length == 4){ //Program
         if(jQuery('input[id^="'+lId+'S"]').length==0){
            concat = concat +':'+ jQuery(this).val();
         }
      }
      //alert('TOTAL['+concat+']');
    });
   $s('P3_PARTNER_TIERS',concat.substring(1));
   //alert($v('P3_PARTNER_TIERS'));
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of techhealth
techhealth
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of BILL Carlisle

ASKER


This is in the page

Program (Select All) (Deselect All)

The hyperlink code is below:

<span style="font-weight: bold;">Program 1201</span><a name="ppselectAll" href="javascript:selectAll('selectAll','CK01')"> (Select All)</a><a name="deselectAll" href="javascript:selectAll('deselectAll','CK01')"> (Deselect All)</a>

another one is
<span style="font-weight: bold;">Program 1201</span><a name="ppselectAll" href="javascript:selectAll('selectAll','CK02')"> (Select All)</a><a name="deselectAll" href="javascript:selectAll('deselectAll','CK02')"> (Deselect All)</a>

Open in new window


This is in the page

Program (Select All) (Deselect All)

The hyperlink code is below:

<span style="font-weight: bold;">Program 1201</span><a name="ppselectAll" href="javascript:selectAll('selectAll','CK01')"> (Select All)</a><a name="deselectAll" href="javascript:selectAll('deselectAll','CK01')"> (Deselect All)</a>

another one is
<span style="font-weight: bold;">Program 1201</span><a name="ppselectAll" href="javascript:selectAll('selectAll','CK02')"> (Select All)</a><a name="deselectAll" href="javascript:selectAll('deselectAll','CK02')"> (Deselect All)</a>

Open in new window


This is in the page

Program (Select All) (Deselect All)

The hyperlink code is below:

<span style="font-weight: bold;">Program 1201</span><a name="ppselectAll" href="javascript:selectAll('selectAll','CK01')"> (Select All)</a><a name="deselectAll" href="javascript:selectAll('deselectAll','CK01')"> (Deselect All)</a>

another one is
<span style="font-weight: bold;">Program 1201</span><a name="ppselectAll" href="javascript:selectAll('selectAll','CK02')"> (Select All)</a><a name="deselectAll" href="javascript:selectAll('deselectAll','CK02')"> (Deselect All)</a>

Open in new window

Woops.. it didn't seem to be taking my code attachment. Then I refreshed and saw it took the wrong one..

Under the code the second link is Program 4233 - both are different checkbox groups..
The checkboxes IDs are named CK01F05K03 for example
so all the checkboxes in that group start with CK01
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Actually your comment that said jQuery works it made me start to trouble shoot more.. and I found an incorrect name in my links. Thanks for the attention to my question!