Jump to content

Contact form


chiarar

Recommended Posts

If try sending anything through contact form (www.creativecollective.biz/contact.php) I don't receive email in my inbox. I also wanted message - Thank you for contacting us. We will be in touch with you very soon to appear once sent. 

 

Form doesn't seem to send when I press send and then form becomes blank.

 

Thank you for your help

Link to comment
Share on other sites

Ok great, now if I change then the page loads to this url - it doesn't email or return to contact form with message saying sent.

http://www.creativecollective.biz/contact-action.php?name=chiara&email=chiararestucci%40googlemail.com&subject=tester&message=tester&submit=Send+Message

 

I really have no idea what this means.

Further help much appreciated.

Thanks

Link to comment
Share on other sites

I guess your contact-action.php file is expecting a post action. So, you also need to add that:

<form action="contact-action.php" method="post" id="contactForm">

The output on that file will either be "OK" or a validation error message. You can modify those text strings in that file if you want them to be different.

Link to comment
Share on other sites

Hi,

Thank you that it is great, this now send email and does work as you have outlined above.

I was hoping that after the message is sent it would show the 'Thank You' message and hide the form - with script below.

 

I wondered if you might no how I adopt the above to do this.

 

Thanks again for your help.

 

 

 

 

 

 

<script type="text/javascript">
//<![CDATA[
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j("#contactForm").submit(function(){
 
var str = $j(this).serialize();
 
   $j.ajax({
   type: "POST",
   url: "contact.php",
   data: str,
   success: function(msg){
    
$j("#note").ajaxComplete(function(event, request, settings){
 
if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
{
result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
$j("#fields").hide();
}
else { result = msg; }
$j(this).html(result);
}); } });
return false;
});});
//]]>
</script>  

 

Link to comment
Share on other sites

Oh, I didn't even notice the Javascript at the bottom. If you are using AJAX, you can actually put your form HTML back to the way it was:

<form action="#" id="contactForm">

You will need to change the Javascript on line 154 to:

   url: "contact-action.php",

That will send the request to the correct file. And everything else looks ok.

 

I don't see you loading the jQuery library, though. You might also need to add this line in contact.php:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.