I've got a number field in my form which one can input a score here:
<input type="number" min="0" max="100" class="form-control" name="total_score" id='total_score' value="<?php echo $total_score;?>" >(Please enter a score from 0-100)
And before the form is submit, I need to check whether this field is filled. I'd not like to use the required since I don't want to block the user when they need more time to decide the input score.
I tried to catch the value of total score with:
var score = document.getElementsById("total_score").value;
if(score==null){
alert("no score");
}
But seems not working. Any Ideas? Thanks.