Response title
This is preview!
This is part 2 of this question (ok maybe part 3)
Here is a working example: http://jsfiddle.net/UcrD8/63/ Here is a earlier attempt and as you can see this works when selecting the first option: http://jsfiddle.net/UcrD8/4/ But using JQM it uses this as a label for the options and it is not selectable
The functionality to add a new select option is working but if I wanted to remove a selected option, this is not working.
StackOverFlow: http://stackoverflow.com/questions/5392402/jqm-jquerymobile-dynamically-removing-elements
$('#btn-add').click(function () { var container = $('#nominees'); var inputs = container.find('input'); var id = inputs.length + 1; var html = '<input type="checkbox" id="cb' + id + '" value="' + val + '" /> <label for="cb' + id + '">' + name + '</label>'; container.append($(html)); var added = $('#cb' + id); added.checkboxradio(); //added.checkboxradio('refresh'); });
However I am unable to remove them from the form ?? any ideas?
The following isn't working
$('#btn-remove').click(function () { var n = $("#nominees input:checked").length; $('#nominees input:checked').each(function () { $(this).remove(); //$(this).checkboxradio("refresh"); $('#page_1').trigger('create'); }); });
© 2013 jQuery Foundation
Sponsored by and others.