I want to validate a form where any field should not be blank. I don’t know the name of the fields. The code is:
<form action="/addproductgroupinsert_fun/" method="post" name="SForm" onsubmit="return validateForm()">
{% for id in ProductTypefeatureentryList %}
<label for="{{id.Name}}">{{id.Name}}</label>
<input id="{{id.Name}}" type="text"name="{{id.Name}}" />
{% endfor %}
How can do this?
In your template, add a class to mark them as required. Then you can validate all of the elements with that class:
in
validateForm():