Try indenting your code uniformly - it helps with readability:
Code:
var messageDelay = 2000;
$(function(){
$("#inquiry_form").submit(function(){
$("#btn_submit").value='Please wait...';
$.post(
"contactform.php?send=comments", $("#inquiry_form").serialize()
, function(data){
if(data.frm_check == 'error'){
$("#message_post").html("<div class='errorMessage'>ERROR: " + data.msg + "!</div>");
document.ContactForm.submitf.value='Resend >>';
document.ContactForm.submitf.disabled=false;
} else {
$("#message_post").html("<div class='successMessage'>Your message has been sent successfully!</div>");
$("#name").val("");
$("#email").val("");
$("#message").val("");
$("#subject").val("");
$('#message_post').delay(messageDelay+500).fadeTo( 'slow', 1 );
$('#message_post').val("").fadeTo( 'slow', 1 );
$("#btn_submit").value='Send >>';
}
}
, "json"
);
function disablePopupContact(){
if(popupContactStatus==1){
$("#popupContact").fadeOut("slow");
popupContactStatus = 0;
}
return false;
});
});
Now, it's much easier to see that there's a missing curly brace (it belongs to your disablePopupContact function), because you can notice that the opening and closing braces don't line up properly:
Code:
var messageDelay = 2000;
$(function(){
. $("#inquiry_form").submit(function(){
. .
. . /* snip */
. .
. . function disablePopupContact(){
. . . if(popupContactStatus==1){
. . . $("#popupContact").fadeOut("slow");
. . . popupContactStatus = 0;
. . . }
. . . return false;
. . } /* <-- this one was missing */
. }); /* <-- matches $('inquiry_form').submit */
}) /* <-- matches anon function */
See how that closing brace is now at the same column position (8) that the word "function" starts on?
Also, most code editors have the ability to highlight opening/closing brace pairs, and warn you when one is missing.
Bookmarks