I'm still relatively new to Javascript, just working my way through some tutorials. I have three select boxes in my HTML form as shown below.
HTML Form:
<table>
<form id="enrolment" name="enrolment" onsubmit="return datevalidate();" action="" method="POST" >
<div style="text-align: center"><h3>Enrollment Form</h3></div>
... (HTML code continues)
Here is the accompanying Javascript code:
<script>
function datevalidate()
{
var d = new Date();
var date = d.getDate();
var month = d.getMonth()+1;
var year = d.getFullYear();
var cdate = document.getElementById("Coursedate").value;
var cmonth = document.getElementById("coursemonth").value;
var cyear = document.getElementById("courseyear").value;
... (Javascript code continues)
}
</script>
I feel like there's room for improvement here. Are there any resources or tutorials available for more comprehensive validation in Javascript? Specifically, I want to ensure that the selected date does not exceed the current date.
Thank you in advance,
Amod from India