[Django]-Insert a variable from JS to Django form input field

6👍

If you’re using plain javascript (not jQuery or any frameworks) you can access the field by document.getElementById('id_distance').value. You can set it’s value by document.getElementById('id_distance').value = <some_var>;

Leave a comment