Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
crotonrz authored Oct 31, 2024
1 parent a2d001a commit 25ca3e7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
display: block;
font-weight: bold;
}
input[type="text"], textarea {
input[type="text"], input[type="email"], textarea {
width: 100%;
padding: 8px;
box-sizing: border-box;
Expand Down Expand Up @@ -74,7 +74,7 @@ <h1>EZ Donation Text Generator</h1>
</div>
<div class="form-group">
<label for="email">Your Email Address</label>
<input type="text" id="email" name="email" placeholder="Enter your email address" required>
<input type="email" id="email" name="email" placeholder="Enter your email address" required>
</div>
<div class="form-group">
<label for="comment">Comments (optional)</label>
Expand All @@ -94,6 +94,13 @@ <h2>Generated Text</h2>
const email = document.getElementById("email").value;
const comment = document.getElementById("comment").value;

// Check if email is valid
if (!email.includes("@") || !email.includes(".")) {
alert("Please enter a valid email address.");
return;
}

// Generate output text
const output = `Character Name: ${characterName}\nEmail: ${email}\nComments: ${comment}`;
document.getElementById("output").textContent = output;
}
Expand Down

0 comments on commit 25ca3e7

Please sign in to comment.