Commit 8391b10f authored by Anze Vavpetic's avatar Anze Vavpetic
Browse files

minor fix to avoid clashes with element ids

parent 31509c1a
......@@ -8,7 +8,7 @@
<li class="ui-widget-content" id="{{id}}">{{ descr }} FP={{fp}}, TP={{tp}}</li>
{% endfor %}
</ol>
<input type="hidden" name="selected_subgroup_ids" id="selected_subgroup_ids" value=""/>
<input type="hidden" name="selected_subgroup_ids" id="selected_subgroup_ids{{widget.pk}}" value=""/>
<input type="hidden" name="widget_id" value="{{widget.pk}}"/>
</form>
<style>
......@@ -20,14 +20,14 @@
<script type="text/javascript">
$(function () {
// Empty list on load
$('#selected_subgroup_ids').val(JSON.stringify([]));
$('#selected_subgroup_ids{{widget.pk}}').val(JSON.stringify([]));
$("#selected_subgroups{{widget.pk}}").selectable({filter : "li"}, {
stop: function() {
var selected = [];
$('.ui-selected', this).each(function(){
selected.push($(this).attr("id"));
});
$('#selected_subgroup_ids').val(JSON.stringify(selected));
$('#selected_subgroup_ids{{widget.pk}}').val(JSON.stringify(selected));
}
}
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment