Hello,
I wonder if anyone has some insight here. I am trying to use formInputs.field_name.value and see:
"Uncaught TypeError: 'get value' called on an object that does not implement interface HTMLInputElement."
in latest Firefox and a similar error in Chrome. My code is very simple:
{% block content %}
{{ formfield 'comprehension4' }}
<button type="button" onclick="check_comprehension4()">Check the answer</button>
<p>
{% endblock %}
{% block scripts %}
<script>
function check_comprehension4() {
let comprehension_check_value = formInputs.comprehension4.value;
console.log(comprehension_check_value);
if (comprehension_check_value != 3.00) {
alert("Not correct, try again");
}
}
</script>
{% endblock %}
When I inspect the javascript object that formInputs.comprehension4 gives, I can see that "value" is correct. However, when I try to access using formInputs.comprehension4.value I see this error.
Thanks for your time!