hello boss! can any one help me to do this. :S
my .ajaxForm() code is working but i want to have validation first for the field before ajax start to work.
here's my code:
my script:
<script>
$(document).ready(function()
{
$('#myForm').validate({
rules: {
newsletter: {
required: true,
email: true}
}
});
$('#myForm').ajaxForm(function() {
alert("Thank you!");
});
});
</script>
my form:
<form id="myForm" action="savenewsletter.php" method="post">
Name: <input type="text" name="newsletter" />
<input type="submit" value="Submit Comment" />
</form>
my php
mysql_query("INSERT INTO newsletter_tb (newsLetterEmail) VALUES ('$_POST[newsletter]')");