Hi there,
This may be a quick and easy one to solve - I'm new to javascript coding, but I've managed to get a modal overlay working as a 'contact me' overlay. Once the form posts back to the server with success, it then tells the user (still within the overlay) that the email was sent etc. All well and good so far.
The only problem I have is that when I place a Close button on the confirmation notice (ESC key is disabled on the modal/overlay) I cn't get it to close the modal at all. I have assigned it the 'close' class From reading other posts it would seem that because the contact form itself is AJAX, the scripts will already have run by the time the Cancel button has loaded and therefore the class="close" will not execute in the confirmation page as I had hoped it would.
Is there a simple way to bind a 'close' to the button in the following code to get the modal/overlay to close please?
Been searching around on the Net and everything points to closing the window (which I don't want) as opposed to only the modal/overlay?
Thanks in advance,
David
This may be a quick and easy one to solve - I'm new to javascript coding, but I've managed to get a modal overlay working as a 'contact me' overlay. Once the form posts back to the server with success, it then tells the user (still within the overlay) that the email was sent etc. All well and good so far.
The only problem I have is that when I place a Close button on the confirmation notice (ESC key is disabled on the modal/overlay) I cn't get it to close the modal at all. I have assigned it the 'close' class From reading other posts it would seem that because the contact form itself is AJAX, the scripts will already have run by the time the Cancel button has loaded and therefore the class="close" will not execute in the confirmation page as I had hoped it would.
Is there a simple way to bind a 'close' to the button in the following code to get the modal/overlay to close please?
if(hasError == false) {
$(this).hide();
$("#sendEmail li.buttons").append('<img src="images/loading.gif" alt="Loading" id="loading" />');
$.post("emailer.asp",
{ Name: Name, Email_address: Email_address, Subject: subjectVal, Message: messageVal },
function(data){
$("#contact").slideUp("normal", function() {
$("#contact").before('<h1>Success</h1><p>Your email was sent.</p><p></p><p><button type="button" class="close"> Cancel </button></p>');
});
}
);
}
return false;
});
});
</script>
Been searching around on the Net and everything points to closing the window (which I don't want) as opposed to only the modal/overlay?
Thanks in advance,
David