About

Labels

slider

Recent

Navigation

Give the Blogger contact form error message in alert window or dialog box using Jquery

Give the Blogger contact form error message in alert window or dialog box using Jquery

I've already shared a tons of tricks related to Blogger Contact Form.This one is somehow related to last post I'd published about Blogger contact form.In this post I am going to tell that when a user do not write E-mail or description in form then a message will be shown in a dialog or alert window.As it is shown in the image above,so lets begin with it.
If you do not have Jquery,then add the following line just after <head>.
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
Then add the following script just before </head>
<script type='text/javascript'>//<![CDATA[
$(function(){
  $('.contact-form-button-submit').click(function(){
$('.contact-error,.contact-success').hide();
var email="Cowboy! Provide the correct E-mail.";
var description="Whats your problem Sir write in description box.";
  if($('.contact-form-error-message-with-border').text()=="A valid email address is required."){
    alert(email);
$('.contact-form-error-message-with-border').hide();
  }
    else if($('.contact-form-error-message-with-border').text()=="Message field cannot be empty."){
alert(description);
$('.contact-form-error-message-with-border').hide();
    }
        else{
        }
  });
});
//]]></script>
Replace the Yellow text for E-mail error and Orange for description error.

Holla! If you didn't get anything,we are waiting for comments.
Share
Banner

Muhammad Hamza

Themelet provides the best in market today. We work hard to make the clean, modern and SEO friendly blogger templates.

Post A Comment:

0 comments: