On my page, I need to select the parameter values loaded by the $ .post function. I have a button for “moving” data from one selection to another. The example works on a new page, but not on my page. Selected items do not move to another selection after clicking.
The question is, is there any other way to do this, or how can I fix my page to make it work?
Code example:
<div style="float:left; border:1px solid red;">
<div style="background-color:red; color:white;" align="center">INFORMATIVE</div>
<div id="prop_info" style="float:left;">
<div style="border:1px solid red;">PROPOSTI</div>
<div style="float:left"><select multiple id="sel_info_pro" name="sel_info_pro" class="sel"><option value="b">a</option><option>b</option></select></div>
<div style="float:left;"><a href="#" id="add_info"> >> </a><br><a href="#" id="remove_info"> << </a></div>
</div>
<div id="conf_info" style="float:left;">
<div style="border:1px solid red;">CONFIGURATI</div>
<select multiple id="sel_info_conf" name="sel_info_conf" class="sel"></select>
</div>
</div>
$(document).ready(function(){
$('#add_info').click(function() {
return !$('#sel_info_pro option:selected').remove().appendTo('#sel_info_conf');
});
$('#remove_info').click(function() {
return !$('#sel_info_conf option:selected').remove().appendTo('#sel_info_pro');
});
});
source
share