Dude,
I cannot use cs forms or Contact Form & as these plugins conflict with the events plug I have. therfore my options are very limted along with my javavscript skills.
I have managed to locate the code both the javascript and the php code I have taken what I think to be correct but I do need some help with both javascript and php what do I need to change ?
Javascript code:
function checkElements()
{
// reset validation var and send data
send.validationError = false;
send.datastring = 'ajax=true';
send.formElements.each(function(i)
{
var currentElement = $(this),
surroundingElement = currentElement.parent(),
value = currentElement.val(),
name = currentElement.attr('name'),
classes = currentElement.attr('class'),
nomatch = true;
send.datastring += "&" + name + "=" + value;
if(classes.match(/is_empty/))
{
if(value == '')
{
surroundingElement.attr("class","").addClass("error");
send.validationError = true;
}
else
{
surroundingElement.attr("class","").addClass("valid");
}
nomatch = false;
}
if(classes.match(/is_email/))
{
if(!value.match(/^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/))
{
surroundingElement.attr("class","").addClass("error");
send.validationError = true;
}
else
{
surroundingElement.attr("class","").addClass("valid");
}
nomatch = false;
}
if(nomatch && value != '')
{
surroundingElement.attr("class","").addClass("valid");
}
});
if(send.validationError == false)
{
send_ajax_form();
}
return false;
}
});
}
})(jQuery);
PHP Code
<form action="" method="post" class="ajax_form">
<fieldset><?php if (!isset($errorC) || $errorC == true){ ?><h3><span><?php _e('Send us mail','avisio'); ?></span></h3>
<p class="<?php if (isset($the_nameclass)) echo $the_nameclass; ?>" ><input name="yourname" class="text_input is_empty" type="text" id="name" size="20" value='<?php if (isset($the_name)) echo $the_name?>'/><label for="name"><?php _e('Your Name','avisio'); ?>*</label></p>
<p class="<?php if (isset($the_emailclass)) echo $the_emailclass; ?>" ><input name="email" class="text_input is_email" type="text" id="email" size="20" value='<?php if (isset($the_email)) echo $the_email ?>' /><label for="email"><?php _e('E-Mail','avisio'); ?>*</label></p>
<p class="<?php if (isset($the_numberlass)) echo $the_numberclass; ?>" ><input name="phone" class="text_input is_empty" type="text" id="phone" size="20" value='<?php if (isset($the_number)) echo $the_number ?>' /><label for="phone"><?php _e('Phone No','avisio'); ?>*</label></p>