Problem with moving item from select1 to select2
I am trying a new tactic to get a list of medical procedures performed. I am loading select1 with procedure codes and having a person click on add to add to select2. But I cannot get it to work. I followed the code closely but I am sure I am doing something wrong being new to JQuery.
Appreciate any and all assistance.
In script area:
- $().ready(function() {
- $('#add').click(function() {
- return !$('#select1 option:selected').appendTo('#select2');
- });
- $('#remove').click(function() {
- return !$('#select2 option:selected').appendTo('#select1');
- });
- });
In body:
- <SELECT id="select1" name="select1" size="3"><OPTION value="1">Test 1</option><OPTION value="2">Test 2</option></select>
- <SELECT id="select2" name="select2"></select>
- <br><input type="button" id="add" value="Add >>"><input type="button" id="remove" value="<< Remove">
Thanks.
Mike