I have contact form on a HTML page called contact.html
Once someone has filled out their details, typed their message & clicked on 'Send' it goes to a PHP file 'contact/contactform.php'
If the message is sent successfully the contactform.php will then redirect to thanks.html (which basically says 'Thanks, your message has been sent etc.')
Or if the message wasn't sent successfully the contactform.php will redirect to error.html (Sorry, there was an error. Your message hasn't been sent etc.')
What I'd like to is instead of contactform.php redirecting to thanks.html or error.html I'd like to call some JavaScript functions back in the contact.html page
Code:
<script type="text/javascript">
function doThanks() {
Effect.Appear('send',{duration:1.0}), Effect.SlideDown('send',{duration:1.0});
return false;
}
</script>
if the message is sent successfully.
Code:
<script type="text/javascript">
function doError() {
Effect.Appear('send',{duration:1.0}), Effect.SlideDown('send',{duration:1.0});
return false;
}
</script>
If the message isn't sent successfully.
Here is the code in the PHP file that redirects to the thanks.html or error.html pages
Code:
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=thanks.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
}
Is this possible, & if so how? 
Last edited by FOOOD; 10-27-2006 at 01:55 PM..
|