Form.php
<form autocomplete="off" enctype="multipart/form-data" method="post" name="form">
<p></p>
<div class="form-elements-malling">
<label for="fullnamemalling">Name<br /></label>
<input type="text" name="fullnamemalling" id="fullnamemalling"/>
<span></span>
</div>
<p> </p>
<div class="form-elements-malling">
<label for="emailmalling">Email<br /></label>
<input type="text" name="emailmalling" id="emailmalling"/>
<span></span>
<input type="submit" value="Submit" style=" background:#0060a1; color:#FFFFFF; font-size:14px; border:0; " class="submit"/>
<span class="error1" style="display:none"> Please Enter Valid Data</span>
<span class="success" style="display:none"> Registration Successfully..</span>
</div>
</form>
validate.js
Inserting Done No Problem okay .. But i need To Know how Can i do
email = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/ ;
i need any ally visitor if write name & e-mail = Code Do 1 check email If mail true do submit If mail false .error = mail not valid ??
2 - i need Code Search in the database - if found the same e-mail error = email already exists and dont send
$(function() {
$(".submit").click(function() {
var fullnamemalling = $("#fullnamemalling").val();
var emailmalling = $("#emailmalling").val();
var dataString = 'fullnamemalling='+ fullnamemalling + '&emailmalling=' + emailmalling;
if(fullnamemalling=='' || emailmalling=='')
{
$('.success').fadeOut(200).hide();
$('.error1').fadeOut(200).show();
}
else
{
$.ajax({
type: "POST",
url: "./styles/libs/validatemalinglist.php",
data: dataString,
success: function(){
$('.success').fadeIn(200).show();
$('.error1').fadeOut(200).hide();
}
});
}
return false;
});
});
please help me