I am struggling with my HTML and JavaScript files to collect data. Despite my efforts, the function is not executing properly.
Below is the code I have been working on:
HTML File :
<form class="form-newsletter">
<div class="form-group">
<span><input type="text" name="name" value="" class="input-type" placeholder="Enter Your Email"></span>
<input type="submit" class="btn btn-yellow" value="SUBMIT" onclick="newsletterFormFunctions()"/>
</div>
</form>
JS File:
function newsletterFormFunctions() {
NewsletterConfig.email = '';
NewsletterConfig.name = 'Test';
console.log('Attempted here');
$('form.form-newsletter input[type="submit"]').click(function (evt) {
validateForm();
});
function validateForm() {
$('form.form-newsletter input[type="submit"]').prop('disabled', true);
$('form.form-newsletter input[type="submit"]').val('LOADING');
NewsletterConfig.email = $('form.form-newsletter input.input-type').val();
}
}