Safari Ajax bug? checked radio not checked -


In Safari, if I load a piece of html through XHR, then the browser does not show the radio button in which the checked "checked" attribute is checked.

I get the html via AJAX:

  & lt; Input type = "radio" name = "radiotest" value = "off" & gt; & Lt; Input type = "radio" name = "radiotest" value = "current" check = "check" & gt;   

The browser presents two unchecked radio buttons, if I do not load the exact same code from the same HDML file (an AJAX), then rendering the radio button in their form After all, it was finally investigated.

What's wrong, is this a known bug? Is there a fix available?

Edit:

Check it looks like a browser bug, and I could not fix it with jQuery post processing yet, I appreciate any help here. I have found:

I have a page that pulls some form elements through AJAX. This is html:

  & lt; Input type = "checkbox" name = "checktest" & gt; & Lt; Input type = "checkbox" name = "checktest" checked "check" & gt; & Lt; Input type = "radio" name = "radiotest" value = "off" & gt; & Lt; Input type = "radio" name = "radiotest" value = "current" check = "check" & gt;   

After being dragged into the form element, checkboxes are rendered correctly, but the radio renders both unobtrusive Now, if I run the following jQuery commands (from Safari 5 console): < / P>

  $ ('# activemodules input [check = "check"]');   

.. This returns an item with a check checkbox.

But if I run the command:

  $ ('#activemodules input [value = "on"]');   

It actually puts the right object back, and it also shows its external external properties as well:

  External HTML: "Input Type =   

Now, if I do:

  "radio" name = "radiotest" value = "current" check = "check" & gt; $ ('# Active module input [value = "on"]'). Attr ('checked', 'checked');   

Safari accepts it, and renders it correctly. I suppose to catch all the radio buttons and 'check again' after I loaded the AJAX bit. Data-Ashkeded = "true" attribute must be passed. But still, even though I can do this, I want to hear any comments or suggestions on this.

How did this end my solution:

  & Lt; Input type = "radio" name = "foo" data  

First I am checking a data-absorbed = "1" characteristic radio:

  -Security = "1" value = "bar" check = "check" & gt;   

Then, after the Ajax call is successful and finished, I run it:

  $ ('# myradios: radio') .each (function () (If ($ (this) .data ('searched')) {$ (this) .attr ('checked', 'check'); $ (this) .removeAttr ('data check');} });   

It seems to work fine .. but I found some other thing of importance:

If I asked the data attribute then instead of data checking, data-checking It does not work, maybe it's a reserved name?

even more; If I run the operation on the broad selector area:

  $ (': radio') .each ...   

Still it does not work < / P>

I do not know why, but adding an ID of the original element of the radio which was also part of the HTML code brought back to the sealer scope like this:

 $ ('# Myradios: radio')   

It worked.

Comments