Skip to content

Commit

Permalink
date validated
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhipai78 committed Jun 1, 2024
1 parent 7b0a13a commit d8e86b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plantrip.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<script>
function handleSubmit(event) {
event.preventDefault();
const today = new Date();
const today = new Date(); // Get today's date
const startDate = new Date(document.getElementById('startDate').value);
const endDate = new Date(document.getElementById('endDate').value);

Expand All @@ -120,7 +120,8 @@
alert('Start and end dates cannot be earlier than today.');
} else {
alert('Trip planned successfully!');

// You can proceed to submit the form or perform other actions here
// For demonstration, form submission is prevented.
}
}

Expand Down

0 comments on commit d8e86b0

Please sign in to comment.