Hello I am trying trouble setting up the recipient address to my contact form. I would appreciate if you can help me out! Thanks.
I am assuming you set up the recipient adders in the .js code so here I am sharing it :
[code]
// contact
var error = true;
function addLoading()
{
$(‘#sendbutton’).val(‘wait…’).attr(‘disabled’, true);
}
function removeLoading()
{
$(‘#sendbutton’).val(‘Send’).attr(‘disabled’, false);
}
function addError(msg, e)
{
error = true;
$(e).addClass(‘error’);
$(‘#usermessagea’).html(msg);
}
function removeError(e)
{
error = false;
$(‘#usermessagea’).html(”);
$(e).removeClass(‘error’);
}
$(‘#email’).blur(function(){
var expr = /^[_a-z0-9+-]+(.[_a-z0-9+-]+)*@[a-z0-9-]+(.[a-z0-9-]+)+$/;
if( !expr.test( $(this).val() ) )
addError(‘<p class=”error”>Email is incorrect!</p>’, this);
else
removeError(this);
});
$(‘#form-contact .required’).blur(function(){
if( $(this).val() == ” )
addError(‘<p class=”error”>One or more field required are empty!</p>’, this);
else
removeError(this);
});
$(‘#form-contact’).submit(function(){
if( !error )
{
var datastring = ”;
$(‘#form-contact input, #form-contact select, #form-contact textarea’).each(function(){
datastring = datastring + $(this).attr(‘name’) + “=” + $(this).val() + ‘&’;
});
$(‘#usermessagea’).html(”);
addLoading();
$.post( $(this).attr(‘action’), datastring, function(response){
$(‘#usermessagea’).html(response);
removeLoading();
});
}
else
addError(‘<p class=”error”>One or more field aren’t filled correctly!</p>’, this);
return false;
});
});