Include the following code snippet within <head></head>
:
<script src='//code.jquery.com/jquery-latest.js'></script>
<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.";
var success_msg = "Success";
if($('.contact-form-error-message-with-border').text()=="A valid email address is required."){
$('.contact-form-error-message-with-border').replaceWith("<div class='contact-error'>"+email+"</div>");
$('.contact-form-error-message-with-border').hide();
} else if($('.contact-form-error-message-with-border').text()=="Message field cannot be empty."){
$('.contact-form-error-message-with-border').replaceWith("<div class='contact-error'>"+description+"</div>");
$('.contact-form-error-message-with-border').hide();
} else {
// success case
$('.contact-error,.contact-success').html(success);
}
});
});
//]]></script>
email
is the error message for email, while description
is the error message for message.
Note: this original snippet is from here (Author: Mohammad Hamza Dhamiya), success message modification added.