Created
May 31, 2024 14:46
-
-
Save wurwal/7b5d649062a68921f86c4c56a021bf66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery(document).ready(function() { | |
// When the document is ready | |
// Bind a click event to the submit button | |
jQuery('#insert-submit-button').click(function(event) { | |
// Prevent the default form submission | |
//event.preventDefault(); | |
// Check if the email field has a value | |
var emailValue = jQuery('#insert-input-field').val(); | |
// Create a new Date object for 24 hours from now | |
var expires = new Date(); | |
expires.setTime(expires.getTime() + (24 * 60 * 60 * 1000)); // 24 hours in milliseconds | |
// Set the cookie variable with the email value and expiration date | |
document.cookie = "ec_email_cf=" + emailValue + ";expires=" + expires.toUTCString() + ";path=/"; | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment