My webpage has a drop-down menu that is dynamically generated via .jsp and filled with data from a database. However, I am having trouble with a JavaScript validation for two drop-down fields and two date pickers. Despite my limited JavaScript skills, I need to implement this for my project. How do I validate these fields and use 'EXECUTE' to call the class from 'SelectOperation.java'?
The JavaScript validation needs to ensure that the user has selected two drop-down fields and two date pickers before submitting the form. If the criteria are not met, a warning message should be displayed. Where and how should I perform this validation? Your assistance is greatly appreciated.
I believe further JavaScript implementation is necessary in order to achieve this. Thank you in advance for your help.
<% @page import = "allDatabaseOperations.SelectOperation" %>
<% @page import = "java.util.List" %>
<% @page import = "entityBeans.TransactionLog" %>
<% @page import = "entityBeans.Business" %>
<% @page import = "entityBeans.CustomerBranch" %>
<% @page language = "java"
contentType = "text/html; charset=ISO-8859-1"
pageEncoding = "ISO-8859-1" %>
< !DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd" >
< html >
< head >
< link rel = "stylesheet"
href = "../styles/style.css"
type = "text/css" / >
<%
List < TransactionLog > Allbranches = SelectOperation.getInstance().getAllTransactionLog();
List < Business > Businesslevel = SelectOperation.getInstance().getAllBusiness();
List < CustomerBranch > CustBranch = SelectOperation.getInstance().getAllCustomerBranch(); %>
< link rel = "stylesheet"
href = "//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" >
< script src = "//code.jquery.com/jquery-1.10.2.js" > < /script>
<script src="/ / code.jquery.com / ui / 1.11.4 / jquery - ui.js "></script>
<link rel="
stylesheet " href=" / WebContent / styles / style.css ">
<script>
$(function() {
$( "#
fromdate " ).datepicker({
showOn: "
button ",
buttonImage: ".. / .. / images / calendar.png ",
buttonImageOnly: true,
buttonText: "
Select date "
});
});
$(function() {
$( "#
todate " ).datepicker({
showOn: "
button ",
buttonImage: ".. / .. / images / calendar.png ",
buttonImageOnly: true,
buttonText: "
Select date "
});
});
</script>
</head>
<body>
... (HTML form elements and table for displaying transaction logs)
</form>
</body >
< /html>