My form works as it should and i receive the emails from it but if you hit submit without entering data you get an error box informing you what you of required fields - however my submit button stays greyed out, so even if you then fill in those fields you cannot submit the form without a refresh.
Code:
jQuery(document).ready(function(){
$('#success').hide();
$('#contactform').submit(function(){
var action = $(this).attr('action');
$('#contactform #submit').attr('disabled','disabled').after('<img src="images/ajax-loader.gif" class="loader" />');
$("#message").slideUp(750,function() {
$('#message').hide();
$.post(action, {
name: $('#name').val(),
email: $('#email').val(),
phone: $('#phone').val(),
subject: $('#subject').val(),
comments: $('#comments').val(),
verify: $('#verify').val()
},
function(data){
document.getElementById('message').innerHTML = data;
$('#message').slideDown('slow');
$('#contactform img.loader').fadeOut('fast',function(){$(this).remove()});
$('#contactform #submit').attr('disabled','');
if(data.match('success') != null) $('#submit').hide();
}
);
});
return false;
});
});
Any help much appreciated!