Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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...

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,854
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Make use of the onunload event and display some lightbox window to show your feed back form
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    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.

  • #4
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank u both...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •