I have the same issue where i have implemented the below script but it is still allowing me to select a date in the future from the date/time.
<script>
function pastDateValidation()
{
var d=document.getElementById("InsertRecordClient_AML_Date").value;
if(new Date(d) > new Date())
{
alert("Select a date which is before now");
document.getElementById("InsertRecordClient_AML_Date").value="";
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
DavidKennett
Following on from the below post
I have the same issue where i have implemented the below script but it is still allowing me to select a date in the future from the date/time.
<script>
function pastDateValidation()
{
var d=document.getElementById("InsertRecordClient_AML_Date").value;
if(new Date(d) > new Date())
{
alert("Select a date which is before now");
document.getElementById("InsertRecordClient_AML_Date").value="";
}
}
document.getElementById('InsertRecordClient_AML_Date').onchange = pastDateValidation;
</script>
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.