<form action=\"sendEmail.php\" method=\"post\" id=\"contactForm\"> <ul id=\"response\"><!-- The response goes here set to display:none; --></ul> <fieldset>
</fieldset>
</form>
when i click the submit button i want the <fieldset> to fadeout and the <ul> to fade in with the thanks you message , then after X seconds they both revert to there normal state Fieldset visible and ul display none.
Now what is happening that when i click the submit button the ul appears with the thanks you message and still there and the fieldset is always visible. all of this i want it to happened when a successful submit occurs not on an empty fields for example .
it still didn't work? That's weird.. I used the above code for a client to display a landing page which disappears after 3 seconds and then the main site appears.. May be you can paste the javascript part of the code where you are using it?
$(document).ready(function() {
var options = {
target: '#response',
clearForm: true,
beforeSubmit: showRequest,
success: showResponse
};
$('#contactForm').ajaxForm(options);
$('#response').fadeIn(1500);
return false;
});
function showRequest(formData, jqForm, options) {
var queryString = $.param(formData);
return true;
}
function showResponse(responseText, statusText) {
}
my problem is i want the reponse message to disappear after for ex. 2 sec how can i add this to the code i tried to add
$('#contactForm').ajaxForm(options);$('#response').fadeIn(1500);
$('#response').fadeOut('slow');
return false;
});
but it didn`t worked although there was no errors in Firebug ? so how can i achieve this ?
but it`s like this
when i click the submit button i want the <fieldset> to fadeout and the <ul> to fade in with the thanks you message , then after X seconds they both revert to there normal state Fieldset visible and ul display none.
Now what is happening that when i click the submit button the ul appears with the thanks you message and still there and the fieldset is always visible. all of this i want it to happened when a successful submit occurs not on an empty fields for example .
You can do this just after where ever you are displaying your response message.. try it out and let me know ;)