I have a django form on my template like this:
<form action="/my-page/" method="post" name="my_form">{% csrf_token %}
{{ form.non_field_errors }}
<div class="fieldWrapper">
{{ form.txt_filed1.errors }}
<label for="id_txt_field1">Profile Name:</label>
{{ form.txt_filed1 }}
</div>
<p><input type="submit" name='update_button' value="Update" /></p>
</form>
I've been trying to insert a value to a text filed above using javascript but I didn't have much success:
<script type="text/javascript">
document.my_form.form-txt_filed1.value = "my value";
</script>
Any idea what might be the problem? Thank you!
document.my_form.txt_filed1.value = "my value";