У меня есть форма в jsp. Мои поля ввода также «обязательны», но когда я отправляю форму, она не блокирует отправку, если необходимые поля пустые. Я не понимаю, пожалуйста, помогите спасибо advance.Here мой JSP форма:Проверка формы в jsp перед отправкой
<form id="addterminal" name="catForm" action="actions/Terminal.jsp" method="post" enctype="multipart/form-data">
<fieldset>
<label>Add Terminal</label>
<% String action = request.getParameter("action");
if(action == null)
{
}
else if(action.equals("add_success"))
{
%>
<div class="alert success">Terminal added Successfully...</div>
<%
}
else if(action.equals("add_failure"))
{
%>
<div class="alert failure">Terminals not added,File Format is incorrect...</div>
<%
}
%>
<section>
<label for="input">Terminal ID</label>
<div>
<input type="text" id="input" name="tid" required>
</div>
</section>
<section>
<label for="input">Merchant Name</label>
<div>
<input type="text" id="input" name="merchName" required>
</div>
</section>
<section>
<label for="file_upload">Upload Bulk Terminals File<br>
<span>Format of the File should be .csv</span></label>
<div>
<input type="file" id="file_upload" name="termbulkfile">
</div>
</section>
<section>
<div>
<!-- <button onclick="javascript:document.catForm.reset()">Reset</button>
--> <button onclick="javascript:document.catForm.submit()">Submit</button>
</div>
</section>
</fieldset>
</form>
http://stackoverflow.com/qu estions/18849200/форма-подтверждение-в-JSP-использованием JavaScript- – Karthigeyan