I created a django form and I need not to save those values in my database. But I don't know how to access those form values in javascript.
balance.html
<script>
$(document).ready(function () {
$('.dateinput').datepicker();
var a = document.getElementsById("{{ form.start_date }}").val;
alert(a);
});
</script>
<div>
<form action="" method="POST">{% csrf_token %} Start Date: {{ form.start_date }} End Date:{{ form.end_date }}
<br/>
<input type="submit" name="submit" value="See Results" id="tryonce">
</form>
</div>
But I can't get the result. How those form value can be retrieve in javascript ?