help in detecting aol popup blocker

Discussion in 'Javascript' started by dave yan, Sep 24, 2003.

  1. dave yan

    dave yan Guest

    hi,

    i have some forms which use javascript for data validation, e.g.,
    checking to make sure all required fields are completed, checking that
    data falls within valid ranges for certain fields, etc.

    if an error occurs, i'm sending the user a message via the alert
    window. the form is then not submitted until the errors are corrected.

    however, i've discovered that some users using the aol browser are
    able to submit the form without correcting all the errors. upon
    investigating further, i suspect that it has to do with the aol
    browser settings automatically blocking any popup windows.

    my question is: is there a way to detect if the user's browser agent
    has popup blocking enabled so that i can redirect the user to a
    different page with a message that their form will be submitted
    unvalidated?

    or if anyone has better ideas on how to handle this, i'd greatly
    appreciate any assistance.

    tia.


    -----
    -dy
    dave yan, Sep 24, 2003
    #1
    1. Advertising

  2. dave yan

    kaeli Guest

    In article <>,
    enlightened us with...
    >
    > or if anyone has better ideas on how to handle this, i'd greatly
    > appreciate any assistance.
    >


    You should never rely on client-side scripting to validate data. It is a
    convenience to the user to not have to get an error after the page is
    submitted, saving them time and you bandwidth. However, your server-side
    code should validate the exact same things the client-side code does.
    This takes care of popup killers, browsers without script at all (or
    turned off), and malicious users who might try to screw up your database
    or back-end application on purpose.

    That said, an alert will not set off a popup blocker.

    -------------------------------------------------
    ~kaeli~
    All I ask for is the chance to prove that money
    cannot make me happy.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    -------------------------------------------------
    kaeli, Sep 24, 2003
    #2
    1. Advertising

  3. dave yan

    dave yan Guest

    On Wed, 24 Sep 2003 07:35:23 -0500, kaeli
    <> wrote:

    >In article <>,
    > enlightened us with...
    >>
    >> or if anyone has better ideas on how to handle this, i'd greatly
    >> appreciate any assistance.
    >>

    >
    >You should never rely on client-side scripting to validate data. It is a
    >convenience to the user to not have to get an error after the page is
    >submitted, saving them time and you bandwidth. However, your server-side
    >code should validate the exact same things the client-side code does.
    >This takes care of popup killers, browsers without script at all (or
    >turned off), and malicious users who might try to screw up your database
    >or back-end application on purpose.
    >


    i agree wholeheartedly, but the end-user has a bare minimum hosting
    package, so there's not much i can do on the server-side. i've been
    telling them to upgrade and they've been reluctant to do so.


    >That said, an alert will not set off a popup blocker.
    >


    i'm using a code snippet like this:

    msg += myfield.name;
    alert(msg);

    if (msg == null) return true;
    else return false;

    in the form, i use the onsubmit event handler:
    onsubmit="return checkform(this);"

    yet, users using the aol browser do not receive the alert message and
    the form is submitted with the data errors.

    >-------------------------------------------------
    >~kaeli~
    >All I ask for is the chance to prove that money
    >cannot make me happy.
    >http://www.ipwebdesign.net/wildAtHeart
    >http://www.ipwebdesign.net/kaelisSpace
    >-------------------------------------------------


    -----
    -dy
    dave yan, Sep 24, 2003
    #3
  4. dave yan

    dave yan Guest

    On 24 Sep 2003 02:46:15 GMT, (HikksNotAtHome)
    wrote:

    >In article <>, dave yan
    ><> writes:
    >
    >>i have some forms which use javascript for data validation, e.g.,
    >>checking to make sure all required fields are completed, checking that
    >>data falls within valid ranges for certain fields, etc.
    >>
    >>if an error occurs, i'm sending the user a message via the alert
    >>window. the form is then not submitted until the errors are corrected.

    >
    >An alert window, or an alert message? I assume you mean a popup window that
    >alerts the user?
    >


    i guess it would be alert message. i'm not sure if i'm using the right
    terminology. i'm using:

    alert(msg);

    with msg containing the names of the fields which contain errors or
    which are empty.


    > [snipped]
    >
    >>or if anyone has better ideas on how to handle this, i'd greatly
    >>appreciate any assistance.

    >
    >Sure. Anything but a popup. An alert, a confirm, even a hidden/visible div with
    >a warning in it. Any of which would be more reliable than a popup window. (Yes,
    >I use AOL's popup blocker).


    i think i'm using an alert instead of a popup. there is an 'ok' button
    on the dialog box.

    -----
    -dy
    dave yan, Sep 24, 2003
    #4
  5. dave yan

    kaeli Guest

    In article <>,
    enlightened us with...
    >
    > msg += myfield.name;
    > alert(msg);
    >
    > if (msg == null) return true;
    > else return false;
    >
    > in the form, i use the onsubmit event handler:
    > onsubmit="return checkform(this);"
    >


    Don't set false/true depending on the alert. AOL probably returns false
    on the object or someting silly. AOL, if anything, tends to be a silly
    browser that does unexpected things.
    Set your return value depending on if the values are valid.

    if (isValid(document.myForm.myField.value))
    {
    return true;
    }
    else
    {
    alert("problem");
    return false;
    }

    -------------------------------------------------
    ~kaeli~
    All I ask for is the chance to prove that money
    cannot make me happy.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    -------------------------------------------------
    kaeli, Sep 25, 2003
    #5
  6. dave yan

    Markus Ernst Guest

    "HikksNotAtHome" <> schrieb im Newsbeitrag
    news:...
    > In article <>, dave yan
    > <> writes:
    >
    > >>Sure. Anything but a popup. An alert, a confirm, even a hidden/visible

    div
    > >with
    > >>a warning in it. Any of which would be more reliable than a popup

    window.
    > >(Yes,
    > >>I use AOL's popup blocker).

    > >
    > >i think i'm using an alert instead of a popup. there is an 'ok' button
    > >on the dialog box.

    >
    > Yes, thats an alert, not a popup window. If you will post a URL to the

    page in
    > question, or a sample page that demonstrates the problem, I will be happy

    to
    > test it using AOL's browser. I know of no reason why AOL would disallow

    the
    > alert, I use them and get them when using the AOL browser.
    > --
    > Randy


    Are you aware that everybody can submit your form without validation just by
    deactivating Javascript in the browser settings? If this is a problem you
    have to either server-side validate (which was suggested before and you say
    is not possible) or make sure not to provide the form to non-Javascript
    browsers (which you should only do if your target audience is very
    special-interest and has a high motivation to send the form, so they will
    enable Javascript for this purpose).

    You can do this by creating the form with Javascript (use the
    document.write() function) or by writing it into a hidden <div> which lays
    over a visible one that contains a message that Javascript must be enabled.
    Then you simply turn the hidden <div> visible with an onLoad event. If
    Javascript is disabled the user sees the message instead of the form. (Be
    aware that non-CSS browsers see both in this case...)

    HTH
    Markus
    Markus Ernst, Sep 29, 2003
    #6
  7. "Markus Ernst" <> writes:

    > Are you aware that everybody can submit your form without validation just by
    > deactivating Javascript in the browser settings? If this is a problem


    .... then tough luck. Nothing to do about it :)
    Server side validation is the only validation that cannot be avoided, and
    therefore the only validation that can be trusted.

    [Only give form to javascript enabled clients]
    > You can do this by creating the form with Javascript (use the
    > document.write() function) or by writing it into a hidden <div> which lays
    > over a visible one that contains a message that Javascript must be enabled.


    It doesn't prevent the user from turning off Javascript after the page
    has been created/made visible, and it sure doesn't stop the from
    making their own form (or even sending a custom designed GET request
    to the server using telnet).

    /L
    --
    Lasse Reichstein Nielsen -
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
    'Faith without judgement merely degrades the spirit divine.'
    Lasse Reichstein Nielsen, Sep 29, 2003
    #7
  8. dave yan

    dave yan Guest

    On 24 Sep 2003 23:37:33 GMT, (HikksNotAtHome)
    wrote:

    >In article <>, dave yan
    ><> writes:
    >
    >>>Sure. Anything but a popup. An alert, a confirm, even a hidden/visible div

    >>with
    >>>a warning in it. Any of which would be more reliable than a popup window.

    >>(Yes,
    >>>I use AOL's popup blocker).

    >>
    >>i think i'm using an alert instead of a popup. there is an 'ok' button
    >>on the dialog box.

    >
    >Yes, thats an alert, not a popup window. If you will post a URL to the page in
    >question, or a sample page that demonstrates the problem, I will be happy to
    >test it using AOL's browser. I know of no reason why AOL would disallow the
    >alert, I use them and get them when using the AOL browser.


    thank you very much. again, any suggestions or comments are greatly
    appreciated.

    http://ctpberk.org/mentor/mentorapply-js.php

    (sorry about the delayed response. i got caught up in something else
    for a while.)

    ----
    -dy
    dave yan, Oct 2, 2003
    #8
  9. dave yan

    dave yan Guest

    On Mon, 29 Sep 2003 15:11:39 +0200, "Markus Ernst"
    <> wrote:

    >
    >Are you aware that everybody can submit your form without validation just by
    >deactivating Javascript in the browser settings? If this is a problem you
    >have to either server-side validate (which was suggested before and you say
    >is not possible) or make sure not to provide the form to non-Javascript
    >browsers (which you should only do if your target audience is very
    >special-interest and has a high motivation to send the form, so they will
    >enable Javascript for this purpose).
    >
    >You can do this by creating the form with Javascript (use the
    >document.write() function) or by writing it into a hidden <div> which lays
    >over a visible one that contains a message that Javascript must be enabled.
    >Then you simply turn the hidden <div> visible with an onLoad event. If
    >Javascript is disabled the user sees the message instead of the form. (Be
    >aware that non-CSS browsers see both in this case...)
    >
    >HTH
    >Markus
    >


    thanks for the suggestion. right now, i have two pages with the form.
    on the first page, there is a javascript page redirect. if the browser
    is javascript-disabled, then the page is not redirected and the form
    is does not have any scripting associated with any events. (also, no
    placeholder data in the fields.)

    if the browser is enabled, the page is redirected to the form with
    javascript validation.

    ----
    -dy
    dave yan, Oct 2, 2003
    #9
  10. dave yan

    dave yan Guest

    On 02 Oct 2003 22:30:47 GMT, (HikksNotAtHome)
    wrote:

    >In article <>, dave yan
    ><> writes:
    >
    >>>Yes, thats an alert, not a popup window. If you will post a URL to the page

    >>in
    >>>question, or a sample page that demonstrates the problem, I will be happy to
    >>>test it using AOL's browser. I know of no reason why AOL would disallow the
    >>>alert, I use them and get them when using the AOL browser.

    >>
    >>thank you very much. again, any suggestions or comments are greatly
    >>appreciated.
    >>
    >>http://ctpberk.org/mentor/mentorapply-js.php

    >
    >I scrolled all the way to the bottom and submitted the empty form (or rather
    >tried to) and got the alert. As long as a field was empty, I got the alert. So
    >its not AOL's popup blocker at fault.


    thanks. could you tell me which version of aol you're using? also,
    which platform?

    back to the drawing board to figure out what the problem is...

    ----
    -dy
    dave yan, Oct 10, 2003
    #10
  11. dave yan

    dave yan Guest

    On 11 Oct 2003 00:21:13 GMT, (HikksNotAtHome)
    wrote:

    >In article <>, dave yan
    ><> writes:
    >
    >>
    >>thanks. could you tell me which version of aol you're using? also,
    >>which platform?
    >>
    >>back to the drawing board to figure out what the problem is...

    >
    >The only 2 versions that have the popup blocker are 8.0 and 9.0, I tested it in
    >AOL8.0 on Win ME.
    >
    >Can you find out what version AOL and what OS the person is using that has
    >trouble with it? I can come closer to trying to find out why knowing that than
    >you trying to guess at it. If for no other reason than I have access to AOL
    >itself to find out.


    thanks. he's using aol 8.0 on win98. i haven't been able to get any
    information from one of his testers who was experiencing the same
    behavior using an aol browser.

    ----
    -dy
    dave yan, Oct 15, 2003
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Segal

    XP SP2 Popup Blocker & Frames

    Simon Segal, Nov 8, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    382
    Simon Segal
    Nov 8, 2004
  2. Jachu

    new windows popup blocker

    Jachu, May 13, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    870
    Jachu
    May 13, 2005
  3. AssanKhan Ismail

    Google-Yahoo Popup Blocker is not working

    AssanKhan Ismail, Aug 2, 2006, in forum: ASP .Net Security
    Replies:
    0
    Views:
    119
    AssanKhan Ismail
    Aug 2, 2006
  4. Bill M.

    popup blocker code

    Bill M., Nov 3, 2003, in forum: Javascript
    Replies:
    9
    Views:
    137
    Randy Webb
    Mar 11, 2005
  5. Ashish
    Replies:
    2
    Views:
    185
    Richard Cornford
    Oct 31, 2004
Loading...

Share This Page