Skip to content

Commit

Permalink
Merge pull request anuragverma108#1599 from Aarzookhunger/message-length
Browse files Browse the repository at this point in the history
Implemented check over message length
  • Loading branch information
anuragverma108 authored Jun 8, 2024
2 parents 5f8efb8 + cc0dc2b commit 08f95f6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,17 @@ <h2 class="h2 section-title has-underline">
<div id="success-message" style="display:none">Message sent successfully!</div>
</form>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
var form = document.getElementById('contact-form');
var message = document.getElementById('message');

form.addEventListener('submit', function(event) {
if (message.value.length < 50) {
alert("Message length can't be less than 50 characters.");
event.preventDefault(); // Prevent the form from being submitted
}});});
</script>

<ul class="contact-card">
<ul class="contact-card ">
Expand Down

0 comments on commit 08f95f6

Please sign in to comment.