A popup contact form has many benefits. You can add a button/link in every page that pops up the contact form in a modal popup. That makes the contact form easily accessible from any part of the website.
Your web site visitors do not have to 'hunt' for the 'contact us' page.
Download the popup contact form code
You can download the contact form that best fits your needs and then customize as required.
Features of the popup contact form
- Easy to customize
- Standards compliant (100% XHTML 1.0 strict validated, uses CSS)
- Secured against spam bots and attacks
- Ajax submission.
- Hosted on your own web server
- Free!
Installing the contact form on your web site
- Unzip the downloaded contact form code.
- Edit contactform.php and edit the email address to your email address
- Upload the folder contents to your website (to a sub-folder say, /contact)
- See the page a-page.php for an example of integrating a button/link to the popup contact form.
- Include the file popup-contactform.php at the beginning of your php file
- link to the style file popup-contact.css in the
<head>section of your page - PHP include contactform-code.php at the end of your php file (it should come in between
<body>and</body>) - To Open the Popup form on clicking a link, use the code below:
$formproc->AddRecipient('name@your-website.com');//<<---Put your email address here
<a href='javascript:fg_popup_form("fg_formContainer","fg_backgroundpopup");'>Contact us</a>
Customizing the form
To change the style of the form, edit popup-contact.css.
You can add any type of additional fields to the form. The fields will automatically appear in the form submission emails.
For client side validations, this script uses the JavaScript validation library. You can add additional client side validations using the same library. (See the documentation here: JavaScript form validation library).
Additional server side validations can be added in the file 'include/fgcontactform.php' Validate() function.
License

The code is shared under LGPL license. You can freely use it on commercial or non-commercial websites.
Related posts:






{ 68 comments… read them below or add one }
← Previous Comments
i am using Popup contact form with Captcha image verification but it keep returning this error: Automated submission prevention: case 1 failed; what could be the cause.
i am having this very same problem. it would be great if anyone knew how to help
Hi,
i downloaded the 2nd popup contact form with the Captcha verification and when i try loading it and click on contact us, the link to were it should execute is shown below javascript:fg_popup_form etc, but the popup form is not displayed. The strange thing is that i downloaded this form some months ago and it worked immediately…Any ideas on what might be the problem please?
Thanks,Eric..
I tried to use it….. when the page opens up its showing the contact form div…. pls help
I am having the same problem as Kay… ” i am using Popup contact form with Captcha image verification but it keep returning this error: Automated submission prevention: case 1 failed; what could be the cause.”
Can anyone help?
Before using my contact.php page, I uploaded all files including ‘a-page.php’ to do some testing of functionality — getting this error:
Parse error: syntax error, unexpected ‘<' in /home/paulgs/chathamhousing.org/a-page.php on line 31
resending, using .org instead of .com on my website (ooops)
did not modify anything except placed .css in my ‘_css’ folder
Parse error: syntax error, unexpected ‘<' in /home/paulgs/chathamhousing.org/a-page.php on line 31
Hi,
Great script. Tried to edit so form includes a subject line field. Can anyone help with the PHP?
Thanks
Hi I am using the pop up form with the captcha but the captcha image is not showing up. everything else works fine but the image isnt showing up when the form pop’s up. what could be the problem?
Did you resolve this issue? I have the same problem..
hello, how should i do if the a-page.php is not in the same folder??? bcz when i change “require_once(‘popup-contactform.php’)” into “require_once(‘myfoler/popup-contactform.php’)”, “” into “” and “require_once(‘contactform-code.php’)” into “require_once(‘myfolder/contactform-code.php’)”, it doesn’t work!!! what else do i need to change? thanks!
it doesnt work!!! What else do i need to change?
Same problem. Did you have any luck figuring it out?
I’m trying to get checkboxes to work with this form. I’ve tried giving them each their own name, but they all return true whether they’re checked or not. When I try submitting them as an array, no luck either. I’m obviously new at this…but from my research it looks like I need to insert an ‘isset’ for the boxes, but I can’t figure out where I would do that, if I need to do it. Any luck with checkboxes on this form?
Have these issues been solved yet?
Great script! Just wondering if anyone knows if there is a way to get multiple forms going to different emails on the same page?
Ex. page one
Form 1 xxxxxx@yahoo.com
Form 2 xxxxxx@gmail.com
Thanks is advance!
I set up my form, but now I can’t receive the emails that it sends from the form. My email recipient is correct in the file popup-contactform.php. I don’t know what to do??
Same problem as Rufaro..works but no Captcha image.
Demo works fine and viewing dsource seems to show a very different set of code than that downloaded..
have been testing the non-pop-up version which works fine . I see significant difference in the code that creates the captcha image. Could this be the issue?
Great contact form.. but how about installation instructions in ENGLISH?
Hi
Great script.
I need to send in a new page or pop-up javascript (thank you page), after submit success message (not only the message “Thanks for contacting us. We will get in touch with you soon!”)
Can you help me ?, thanks
← Previous Comments