View Full Version : Prompt the visitor to optionally give feedback when leaving the site
03-17-2009, 04:20 PM
I am newbie in webdesign field. I would like to add a prompt when a visitor of my website leaves the site or closes the browser.
The prompt should be to optionally give his/her feedback about the site.
--> User can fill a simple form with comment & email id --> In this case, the comments should go to our mail id
--> The user can also leave the site without giving the feedback, saying NO to the prompt.
How can I create this?
Thanks in advance...
03-17-2009, 04:48 PM
Make use of the onunload event (http://reference.sitepoint.com/html/event-attributes/onunload) and display some lightbox window (http://particletree.com/features/lightbox-gone-wild) to show your feed back form
03-17-2009, 05:06 PM
Make use of the onunload event (http://reference.sitepoint.com/html/event-attributes/onunload)
Every browser listed supports this onunload attribute. However, it should be avoided as it encourages the mixing of content and behavior.
In fact few browsers these days accept mailto as a form action. You need a really old browser for it to work as more modern browsers simply open the email program (if any) and ignore the form. If you are going to use a form then use a server-side formmail script as the action - there are several good free ones out there.
03-18-2009, 07:46 AM
Thank u both...
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.