Note that there are some explanatory texts on larger screens.

plurals
  1. PORadio Buttons getting deselected when dragging item using jQuery Sortables
    primarykey
    data
    text
    <p>I'm using the <a href="http://docs.jquery.com/UI/Sortables" rel="noreferrer">jQuery UI sortables</a> plugin to allow re-ordering of some list items. Inside each list item, I've got a couple of radio buttons which allow the item to be enabled or disabled.</p> <p>When the item is dragged, both radio buttons get deselected, which doesn't seem like it should be happening. Is this correct behavior, and if not, what is the best way to work around this?</p> <p>Here is a code sample demonstrating this problem:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head&gt; &lt;title&gt;jQuery Sortables Problem&lt;/title&gt; &lt;script src="jquery-1.2.6.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="jquery-ui.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;style type="text/css"&gt; .items { margin-top: 30px; margin-left: 0px; padding-left: 25px; cursor: move; } .items li { padding: 10px; font-size: 15px; border: 1px solid #666; background: #eee; width: 400px; margin-bottom: 15px; float: left; clear:both; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;ol id="itemlist" class="items"&gt; &lt;li id="1" class="item"&gt; Item 1 &lt;input name="status_1" type="radio" value="1" checked="checked" /&gt;enabled &lt;input name="status_1" type="radio" value="0" /&gt;disabled &lt;/li&gt; &lt;li id="2" class="item"&gt; Item 2 &lt;input name="status_2" type="radio" value="1" checked="checked" /&gt;enabled &lt;input name="status_2" type="radio" value="0" /&gt;disabled &lt;/li&gt; &lt;li id="3" class="item"&gt; Item 3 &lt;input name="status_3" type="radio" value="1" checked="checked" /&gt;enabled &lt;input name="status_3" type="radio" value="0" /&gt;disabled &lt;/li&gt; &lt;li id="4" class="item"&gt; Item 4 &lt;input name="status_4" type="radio" value="1" checked="checked" /&gt;enabled &lt;input name="status_4" type="radio" value="0" /&gt;disabled &lt;/li&gt; &lt;/ol&gt; &lt;script type="text/javascript"&gt; $('#itemlist').sortable(); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>As soon as a list item is grabbed with the mouse, both the radio buttons get deselected.</p> <p>If this is a bug, one workaround would be to automatically select the 'enabled' radio button when the item is moved, so any advice on how to achieve this would also be most appreciated.</p> <p>Update: I've tested this in FireFox 3, Internet Explorer 7, Opera 9.5, and Safari 3.1.2, all on Windows XP x64, and this issue occurs in all of them.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload