Hi all.
I am new to Java Script.
I try to make function to compare date with current date.
If the date entered by the user is greater than current date, it will display alert message.
However, it is not functioning.
Can anyone explain to me what is wrong with the function.
And, correct me if I am wrong.
Thanks in advance.
Below is the function.
HTML Code:<script language="javascript1.2"> function tarikh_lantikan() { valf = "dd/MM/y"; var myDate = document.form1.tarikhmula.value; var today = new Date(); myDate2 = isDate(myDate,valf); today2 = isDate(today,valf); if (myDate2 > today2) { alert('Tarikh salah.'); document.form1.tarikhmula.focus(); return false; } } </script>




Reply With Quote