SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member happysailingdude's Avatar
    Join Date
    Apr 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question javascript: are you sure you want to navigate away from this page?

    hi there, i have a page with a link that i really want my users to click, most of them do - but some of them don't (how dare they!)

    i want to make it so that if they click any link in my page other than my desired link then a java pop up window says "Are you sure you don't want to click that link? If you are sure click OK to navigate to the link you just clicked on, alternatively click CANCEL to return to the page so you can click the special link"

    i'm really no good with javascript, HTML and Coldfusion I'm ok at - but javascript hurts my head

    If anyone could please point me in the right direction I'd be very grateful indeed.

    Thanks guys

    Nick

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,157
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    confirm

    Quote Originally Posted by happysailingdude
    please point me in the right direction
    The "right direction" is to NOT annoy your visitors with a pop-up pestering them about a link. Although such a technique might be acceptable before submitting data from a lengthy form, doing so just to have them click a link would be enough to "turn off" and turn away some users.
    But if you insist, check out confirm().

  3. #3
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I agree with Mittineague. I can personally say that if a website chose to alert a confirmation on me leaving a website, I'd never return.

  4. #4
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aaron.martone
    I agree with Mittineague. I can personally say that if a website chose to alert a confirmation on me leaving a website, I'd never return.
    Same, if something pops up and tells me I *should* click this or that and doesn't allow me to investigate the site as I want to, I'm out of there and never to return

    Nadia

  5. #5
    Carpe Diem = Fish of the Day fisherboy's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Nadia P
    Same, if something pops up and tells me I *should* click this or that and doesn't allow me to investigate the site as I want to, I'm out of there and never to return

    Nadia
    And same again. If I visit a site that wants to tell me where I "should" go I either leave the site immediately or disable Javascript so I can go where I want "pop-up free".

    I understand you want to make it as sticky as possible but please don't forget that the visitor has every right to go where they want without being "nagged". (Some of us get enough nagging at home )
    fisherboy
    Web Site Design

  6. #6
    SitePoint Member happysailingdude's Avatar
    Join Date
    Apr 2006
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    you've missunderstood me

    ok, hang on a minute there guys - i fear youve missunderstood my intentions

    i made my question a bit brief but to stop you all telling me off perhaps i ought to eloborate a bit more (sorry for the confusion).

    - ok my website shows photos of people that we've taken with their permission

    - users visit the website and click a link under the photo to say "add my name to this photo"

    - they need to be registered to do this so if they are not registered first of all the are taken to the registration page

    - once theyve finshed that they go to the page i need help on..

    - this page says "congratulations you are now registered, now you can add your name to your photo, please click here to do so."

    - it seems from my logs that some users are going through all the effort of registering (so they must be interested) but then are falling at the final hurdle and not clicking the "now registered, now you can add your name to your photo, please click here to do so" link.


    i assure you i am adding this functionality for genuine reasons!

    i want the pop up to have 2 options - "OK i want to leave the page, and CANCEL i want to stay on the page"

    i've seen this done before in a nice way and ive seen it done in an annoying way - i agree with all your comments about doing it in the annoying way - but i assure you i want to do it in the helpful way.

    if anyone could please help me i'd be very grateful - thanks very much indeed.

    Nick

  7. #7
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,157
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)

    confirm

    Quote Originally Posted by Mittineague
    Although such a technique might be acceptable before submitting data from a lengthy form
    That sounds about right, no? Maybe the registration process isn't a lengthy form, but in this case it may help to clearly state the need too click to add the name - and for those users that "just don't get it", as I posted before, use the javascript confirm() function.
    One of these many examples ought to show exactly what ypu're looking for http://www.goodsearch.com/Search.asp...=mozillaplugin


Bookmarks

Posting Permissions

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