Skip to content

Commit

Permalink
Merge pull request #2408 from SrijaVuppala295/form
Browse files Browse the repository at this point in the history
Improved the Subscribe letter form !!
  • Loading branch information
iamrahulmahato authored Nov 10, 2024
2 parents 166e572 + 1bb83ea commit cae0d2e
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ window.onload = function() {

// Handle form submission

document.getElementById('emailForm-nl').addEventListener('submit', function(event) {
event.preventDefault();
document.getElementById("emailForm-nl").addEventListener("submit", function (event) {
event.preventDefault(); // Prevent form from actually submitting or refreshing the page

const emailInput = document.getElementById("email-nl");

// Here you can add code to handle the subscription, e.g., send data to your server

// Clear the input field
emailInput.value = "";

// Optionally, you can display a confirmation message
alert("Thank you for subscribing!");
});

const email = document.getElementById('email-nl').value;
if (email) {
alert(`Your email ID ${email} has been registered successfully for the newsletter.`);
document.getElementById('popup').style.display = 'none';
}
});

// Handle "No thanks" link

Expand Down

0 comments on commit cae0d2e

Please sign in to comment.