var form = $('#main-contact-form'); form.submit(function(event){ event.preventDefault(); var form_status = $('<div class="form_status"></div>'); $.ajax({ url: $(this).attr('action'), method : 'POST', data : $(this).serialize(), beforeSend: function(){ form.prepend( form_status.html('<p><i class="fa fa-spinner fa-spin"></i> Email is sending...</p>').fadeIn() ); } }).done(function(data){ form_status.html('<p class="text-success">Thank you for contact us. As early as possible we will contact you</p>').delay(3000).fadeOut(); $(this).reset(); }); });
To collect a group of elements, we pass the selector to the jQuery function using…
jQuery is a lightweight, "write less, do more", JavaScript library. The purpose of jQuery is…
HTML:- [crayon-67ae035d21cbd448332931/] CSS:- [crayon-67ae035d21cc4951348956/] JavaScript:- [crayon-67ae035d21cc6924037992/]
Prevent users typing special characters in text box, textarea, etc. [crayon-67ae035d21f85197472419/] ^[a-zA-Z]+$ Alphabets ^[a-zA-Z\s]+$ Alphabets…
Any interactive web site has form input - a place where the users input different…
[crayon-67ae035d22505821610321/]