Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-17-2009, 03:20 PM   PM User | #1
itsvijay
New to the CF scene

 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
itsvijay is an unknown quantity at this point
Prompt the visitor to optionally give feedback when leaving the site

Hi All,

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...
itsvijay is offline   Reply With Quote
Old 03-17-2009, 03:48 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Make use of the onunload event and display some lightbox window to show your feed back form
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 03-17-2009, 04:06 PM   PM User | #3
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by abduraooft View Post
Make use of the onunload event
Every browser listed supports this onunload attribute. However, it should be avoided as it encourages the mixing of content and behavior.


The trouble with using mailto: to send form results is its unpredictabiity. The method it is highly dependent on the browser in use and the email client in use. In particular, some of the most popular versions of Internet Explorer/Outlook Express will not work correctly. With all of the browser troubles, you're likely to lose about half of your users' messages. Also, what about people with Javascript disabled?

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.
Philip M is offline   Reply With Quote
Old 03-18-2009, 06:46 AM   PM User | #4
itsvijay
New to the CF scene

 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
itsvijay is an unknown quantity at this point
Thank u both...
itsvijay is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:56 AM.


Advertisement
Log in to turn off these ads.