Using Thickbox to display a contact form in this way enables your readers to email you without having to leave the page. We can add this functionality in a simple HTML gadget, and there is no need to edit the HTML of our template at all.
In this post, I'll explain how easy it is to add a lightbox-style contact form to your Blogger blog using Thickbox and a free Kontactr account.
Create a contact form with Kontactr
At present, Blogger does not offer the means to integrate a contact form natively in our blogs. Since we cannot (easily) use PHP in our Blogger templates, the ideal solution is to use an external service to generate a contact form.My preferred service for simple contact forms is Kontactr - I've been using Kontactr for several years now, and have found this to be both reliable and easy to implement.
So first of all, pop over to Kontactr and create your free account. It takes only a few minutes to register and set up your very own contact form which we'll be using to display in our lightbox-style display:
Once you've created an account and contact form, you'll be presented with a page like this:
Make a note of the URL for your contact form - we'll need to add this to our HTML gadget shortly.
Add "Contact Me" gadget to your Blogger template
We will be using Thickbox to generate the functionality for our lightbox-style contact form. Unlike the original Lightbox script, Thickbox enables us to embed rich content in our display. We'll be embedding our contact form within an iframe using this functionality.On the Page Elements section of your Blogger dashboard, choose to add a new HTML/JavaScript gadget in the area you would like your "Contact Me" link to appear.
Paste the following code into your HTML gadget, replacing "URL-OF-YOUR-KONTACTR-FORM" with the URL of your own contact form, and "Send me an Email" with the text you would like to display:
<script type="text/javascript" src="http://bloggerbuster-tools.googlecode.com/files/jquery.js"></script>
<script type="text/javascript" src="http://bloggerbuster-tools.googlecode.com/files/thickbox.js"></script>
<a href="URL-OF-YOUR-KONTACTR-FORM?TB_iframe=true&height=480&width=640" class="thickbox">
Send Me An Email
</a>
Beneath the code you've just edited, paste the following section of CSS code:
/* ----------------------------------------------------------------------------------------------------------------*/ /* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/ /* ----------------------------------------------------------------------------------------------------------------*/ *{padding: 0; margin: 0;} /* ----------------------------------------------------------------------------------------------------------------*/ /* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/ /* ----------------------------------------------------------------------------------------------------------------*/ #TB_window { font: 12px Arial, Helvetica, sans-serif; color: #333333; } #TB_secondLine { font: 10px Arial, Helvetica, sans-serif; color:#666666; } #TB_window a:link {color: #666666;} #TB_window a:visited {color: #666666;} #TB_window a:hover {color: #000;} #TB_window a:active {color: #666666;} #TB_window a:focus{color: #666666;} /* ----------------------------------------------------------------------------------------------------------------*/ /* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/ /* ----------------------------------------------------------------------------------------------------------------*/ #TB_overlay { position: fixed; z-index:100; top: 0px; left: 0px; height:100%; width:100%; } .TB_overlayMacFFBGHack {background: url(macFFBgHack.png) repeat;} .TB_overlayBG { background-color:#000; filter:alpha(opacity=75); -moz-opacity: 0.75; opacity: 0.75; } * html #TB_overlay { /* ie6 hack */ position: absolute; height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); } #TB_window { position: fixed; background: #ffffff; z-index: 102; color:#000000; display:none; border: 4px solid #525252; text-align:left; top:50%; left:50%; } * html #TB_window { /* ie6 hack */ position: absolute; margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); } #TB_window img#TB_Image { display:block; margin: 15px 0 0 15px; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; border-top: 1px solid #666; border-left: 1px solid #666; } #TB_caption{ height:25px; padding:7px 30px 10px 25px; float:left; } #TB_closeWindow{ height:25px; padding:11px 25px 10px 0; float:right; } #TB_closeAjaxWindow{ padding:7px 10px 5px 0; margin-bottom:1px; text-align:right; float:right; } #TB_ajaxWindowTitle{ float:left; padding:7px 0 5px 10px; margin-bottom:1px; } #TB_title{ background-color:#e8e8e8; height:27px; } #TB_ajaxContent{ clear:both; padding:2px 15px 15px 15px; overflow:auto; text-align:left; line-height:1.4em; } #TB_ajaxContent.TB_modal{ padding:15px; } #TB_ajaxContent p{ padding:5px 0px 5px 0px; } #TB_load{ position: fixed; display:none; height:13px; width:208px; z-index:103; top: 50%; left: 50%; margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ } * html #TB_load { /* ie6 hack */ position: absolute; margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); } #TB_HideSelect{ z-index:99; position:fixed; top: 0; left: 0; background-color:#fff; border:none; filter:alpha(opacity=0); -moz-opacity: 0; opacity: 0; height:100%; width:100%; } * html #TB_HideSelect { /* ie6 hack */ position: absolute; height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); } #TB_iframeContent{ clear:both; border:none; margin-bottom:-1px; margin-top:1px; _margin-bottom:1px; }
Save your gadget and preview your blog. You should now see a simple text link in your layout which, when clicked, brings up a lightbox-style contact form in which your Kontactr email form is embedded!
Advanced Methods
To demonstrate this method, I chose to use Kontactr for embedding a simple free contact form.However, we can use this method to display an alternative contact form (or indeed any other webpage) in your site. Simply replace URL-OF-YOUR-KONTACTR-FORM with the URL of the page you would like to display. This technique could also be used to display large images by using the URL of a hosted image.
The scripts required to operate the Thickbox function are reliably hosted on Google Code. If you prefer to host these scripts yourself (or perhaps build upon them), you can download the scripts I have used from the official ThickBox page.
I hope you find this post useful in creating your own lightbox-style contact form for your Blogger blog. Please feel free to leave your comments below.








48 Comments:
Where's the CSS code we're suppose to add?
All nice and fine but where she says "Beneath the code you've just edited, paste the following section of CSS code:" there is NOthing, nada, empty white space. Now what?
PLEASE don't tell me I have to use IE... ;(
cool, but i would like one for pics just like Kotaku xP
Good day people!
I used Kontactr long ago, and now I'm settled with Commentluv and VisitorContact.
Oh wow, wish I knew about this a month ago. I pay $30 a year at MyContactForm.com and it looks like this on my blog: http://mysnellvilleblog.blogspot.com/p/submit-news.html
Basically, I have to take a whole new page for contact form.
The one you are sharing looks very nice! I guess it's not customizable though, but still - when a person just needs a basic contact form, this looks GREAT! As always, you are just awesome. Love your blog.
Thanks for thid tip. gonna try it.
@Don Risi and Eike Heinze: I've just edited the post to add the missing CSS code. So sorry it hadn't appeared when I first published - still don't know what went wrong with that (but at least it's displaying properly now!)
@MSB - Wow, what a lot to pay for a simple contact form! There are several free options available (as explained, Kontactr is my favourite!) so hopefully you'll now be able to save a bit of money but still have all the functionality of a contact form on your site =]
@MSB - It *would* be possible to customize the form, but it's not such a simple procedure and would involve either creating a new page and editing the JavaScript code or hacking the Thickbox script to display the form within the same page.
If enough people would like a tutorial for this, I'll be happy to write one up!
Thank you for this great information. I've applied it on my site and it works well. By the way I find the KPU Form is too striking especially the contactr's logo unlike shown by http://kontactr.com/test/ button while the background is not transparent. Anyone can refine it?
Nice Reading. Thanks.
LRQA helps bring integrity, independence and world-renowned recognition to your assurance claims.
Quality-ISO 9001 Training
Environmental-ISO 14001 Training
Information Security Management Training
Food & Beverage Industry Management Training
Business Assurance Management Training
Didn't work for me. the entire CSS code showed up on the site instead of just the "contact me"
Thanks for such an informative article, it's been very useful.
Same thing as for Veronica happened to me. The whole CSS code showed up on my blog. No matter how many ways I tried to do this, I even tried to post in in my template before /head and still no luck. I copied the codes as a new HTML gadget, followed the directions above and when i saved my page I got this
Send Me An Email
/* ----------------------------------------------------------------------------------------------------------------*/
/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/
/* ----------------------------------------------------------------------------------------------------------------*/
*{padding: 0; margin: 0;}
/* ----------------------------------------------------------------------------------------------------------------*/
/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/
/* etc...
Why?
It does not work!
Thank you :)
I;m using Kontactr and it's great, never goto any problems since a year ago.
THANK YOU for posting this!! I love your blog...
Steve
Common Cents
http://www.commoncts.blogspot.com
IMT- Ghaziabad is one of the premier B- School of the country and running full time /part time/ Distance Learning Programme from last 24 years.
thanks for your most wanted trics
Hi, Your site looks great, I can tell how much time you have put into it.jade jewelry I am going to save it and will make sure to visit often.
Thanks for this post. I was looking for one of these forms for my blog and I think this suits my needs much better.
i think it's better to avoid these kind futures Coz it's reduces blogger performance..
Cheers
Tech Tasks
@)Amanda - Why browser does not close automatically after sending mail,it is reloading the whole page in same frame of sending mail...any clue ?
WWW.SOULIGNITER.COM
Hi, Your site looks great, I can tell how much time you have put into it. I am going to save it and will make sure to visit often.
Amanda, nice blog..but where should I put css code? reply me at my blog HOW-TO HOUSE
it is perfectly working Amanda brother
Brothers you have to put the css code at edit html template in css section .That's why you didn't get it.Hope it will be a helpful info for you.
for those who doubt check at my blogspot
http://novicetoprogramming.blogspot.com/
Isn't just simpler to add Blogger gadget for this???
My blog: Zarada na internetu
I'm sorry I commented on wrong post.
My blog: Zarada na internetu
Here is some more tips and tricks, check it out:
http://www.high-on-it.co.za/2011/02/adding-lightbox-to-blogger.html
it seems that Thickbox is no longer mantained. Is it possible to do that with an alternative?
Awesome trick,I always miss contact us,shareholic and related post features in blogger platform as they are in wordpress.This post solved one however created a new page and in edit html code did as stated above but it was not displaying the form and was showing the css code below the text linked to my form on kontactr.
Then simply copy pasted the Ajax embed widget and it is displaying on the site but if I need to display any text above or below the form its getting vanished.
Did a test mail and still waiting and its been 15 minutes lets see how long does it take but still a good solution hope to get something official from blogger
Amanda I hope you have provided the authentic information . Whats so ever i will confirm about it
Well I love contractor but now days people using "email me form "
sex
porn
free porn
porn
free sex
free sex
porno
escort bayan
Thanks for the insight. You are absolutely right.
Nice post.Thank you for taking the time to publish this information very useful!
The author has written an excellent article. You have made your point and there is not much to argue about. It is like the following universal truth that you can not argue with: No truth is universal, everything has its exception. Thanks for the info penis enlargement penis enlargement pills VigRX Plus
This is pretty amazing. I noticed that adding a light box style is increasingly becoming popular these days. No question about its benefits. Thanks for the detailed explanation of the coding. I'll try this out. Thanks!
thank youuuuuuuuuuu !!!
Thank you for your great tutorial. I've tried to integrate php mail form into blogger blog,but failed.THis is amazingly easy and cool.
Well your site is very informative and it will be equally worthwhile.Well thanks for this information it will really gonna help a lot of people.
Thanks for taking time for sharing this article; it was excellent and very informative. Excellent. Wonderful. What is interesting here is not just info, but style of presentation of information. Though you make some very fascinating points, you’re going to have to do more than bring up a few things that may be different than what we’ve already heard. Thank you.
Wow nice script, your site very informative thanks
No fillers, colors, and preservatives are added, and never Magnesium Stearate in any form. We are in constant research to find new ways to improve bioavailability of our organic vitamins and natural supplements.
hi great tutorial, would like to know how can i do the same for the feedback, secondly how do u right your post title in front of readmore???
Useful tutorial. I always really like to create Inclusion to my understanding and this one really fulfil my need.
discount ugg boots Yo, Stuart Martin, Hello, Hello, what brings you here it? Said Kai warm. TYbhLQ
ugg discount outlets Special Forces operations section 53 is what?
uggs discounted A new specialty vehicles military vehicles slowly drove into the Warriors red triple their company headquarters, the former stopped in the square, before the down guards quickly opened the door from the car down is the 39 Division Commander Zheng Hongming , see the teacher to a long and red again and again long MENG, political commissar of the meet up quickly, Zhao Chen said.
uggs discount Xuan said that Guan, Zhang said: "I am widowed Zeizhong; will be out of Jones, only to win." Is a sub-military relations hectometer one thousand volts Shan Zuo and Zhang www.hotdiscountbootsoutlet.com
Thanks for the great piece of sharing.I have already bookmarked your blog for future references.The article was really great and that smart phone was very good looking.I am planning to buy a new phone ,so why not try the one I see here...
Post a Comment