i want to write a javascript validation cater to using getElementById() and for loop methods that upon submit it will check the textboxes on the page for empty content before posting to the backend codes to handle the information. Any idea?
<html><body>
<input type="image" src="{{ MEDIA_URL }}images/placebid.png" value="Place Bid" id="iteration_submit" name="iteration_submit" onclick="submitform()">
</body></html>
<script>
function submitform(){
//validation code for textboxes here; if false, do not carry out the submit -->
document.forms[0].submit();
}
let’s say this is your textarea html:
JavaScript:
something like that.