Skip to content

Commit de8b389

Browse files
committed
Fix multiple fields bug.
1 parent 8480e6c commit de8b389

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

json_editor/templates/django_json_editor/django_json_editor.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
iconlib: "fontawesome4",
88
schema: {{ schema|safe }}
99
};
10-
var editor = new JSONEditor(container, options);
11-
editor.on('change', function () {
12-
var json = editor.getValue();
10+
var {{ name }}_editor = new JSONEditor(container, options);
11+
{{ name }}_editor.on('change', function () {
12+
var json = {{ name }}_editor.getValue();
1313
document.getElementById("id_{{ name }}").value = JSON.stringify(json);
1414
});
1515
{% if data %}
1616
var json = {{ data|safe }};
17-
editor.setValue(json)
17+
{{ name }}_editor.setValue(json)
1818
{% endif %}
1919
</script>
2020

0 commit comments

Comments
 (0)