Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved the Subscribe letter form !! #2408

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading