1

I have a very strange bug whereby ie8 would inject the attribute below in the input checkbox html:

jQuery17202259447732522888="19"

<INPUT id=picture-author class=valid value=true type=checkbox name=IsPhotoRiskAccepted data-val-required="The IsPhotoRiskAccepted field is required." data-val="true" _just_changed="true" jQuery172007312802653214206="18"><INPUT value=false type=hidden name=IsPhotoRiskAccepted jQuery172007312802653214206="19">

We are unable to select the checkbox in ie8 due to this attribute. When removing this attribute from the checkbox (through ie8 console) the bug does not occur.

Any help would much be appreciated

Thanks

Wasiim
  • 146
  • 4
  • 16
  • How do you think we can help with this? Please provide code. Preferably the scripts that run on your page. – Bram Vanroy Nov 05 '13 at 06:31
  • ok..i am going to copy paste the whole html for the input checkbox. Unfortunately there are no specific js that binds with this checkbox – Wasiim Nov 05 '13 at 06:36

1 Answers1

1

This "expando" attribute is used by jQuery to keep track of the events bound to your checkbox element. If you can't check it, that's probably because you have an event handler function preventing it.

More here: jQuery attribute auto added to elements

Community
  • 1
  • 1
Romain Paulus
  • 2,306
  • 1
  • 20
  • 20
  • Thanks, i agree with you..but how to remove this attribute? – Wasiim Nov 05 '13 at 06:39
  • If you really need to remove it, you can use `$('input').removeAttr($.expando);`. But I don't see how the attribute itself can be the cause of your problem. Are you sure you haven't any event handler in your code ? Do you have this attributes on other inputs or elements ? – Romain Paulus Nov 05 '13 at 06:44
  • the remove attr does not work - is it in the the global scope? And no, i dont' have this attribute on other inputs..its weird – Wasiim Nov 05 '13 at 07:12
  • Let's try this: 1) is `$.expando;` outputting the right attribute name? (I have never used it but I assumed it was the correct one). 2) Is `$('input');` selecting the right elements? 3) is `.removeAttr()` working on other attributes than `jQuery1234567`? – Romain Paulus Nov 05 '13 at 07:16
  • i modified jquey: expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), replaced to "jQuery0" – Wasiim Nov 05 '13 at 07:27
  • So... the generated `$.expando` was not matching the attribute name ? That's strange. – Romain Paulus Nov 05 '13 at 07:31