Note that there are some explanatory texts on larger screens.

plurals
  1. PORemoving an option from a select and adding it to another
    primarykey
    data
    text
    <p>Okay, so I've had this code that used to work just fine. I recently upgraded my jQuery from 1.4.4 to 1.5.2, and apparently this has quit working. However, I've tried the code with 1.4.4. and 1.3.2 and it won't work there, either.</p> <p>This did work. I can't figure out why it isn't. Any help?</p> <p>Edit: start and end are arguments, with the text of the <code>select</code> element's ID.</p> <pre><code> var selectedIndex = document.getElementById(start).selectedIndex; // get the selected index from the correct select box if (selectedIndex != -1) { // if something is selected, do the following: var selectedElement = document.getElementById(start).options[selectedIndex]; // get the element that's selected if (selectedIndex == (document.getElementById(start).options.length - 1) && selectedIndex != 0) { selectedIndex--; // if we're at the bottom of the list, set our selectedIndex variable to the one right before it } $("#" + start).remove(selectedElement); // remove the selected element from the start side $("#" + end).append(selectedElement); // and add it to the end of the ending side } </code></pre> <p>Here's an example of an option I want to move.<br> <code><code>&lt;option sortable="yes" datatype="string" value="foo" type="arbitrary"&gt;Foo&lt;/option&gt;</code></code></p> <p>The issue I'm getting is apparently within jQuery itself - using the full version,<br><code>expr.replace is not a function [Break On This Error] expr = expr.replace( /\=\s*([^'"]]<em>)\s</em>]/g, "='$1']" ); [jquery-latest.debug.js, line 4540] </code><br>The error happens when I hit the <code>$.remove</code> portion of the code.<br><br> Thanks.</p>
    singulars
    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.
 

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