Results 1 to 7 of 7

Thread: "Required field(s) validation" Quirk/Bug in Chrome

  1. #1
    Join Date
    Mar 2007
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default "Required field(s) validation" Quirk/Bug in Chrome

    1) Script Title: Required field(s) validation

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...uiredcheck.htm

    3) Describe problem: On Google Chrome (not sure about other browsers) there appears to be a single extra "stray" character, appearing as a black box square, after the text of the last field on the ALERT dialog box. This is present even in the demo of the script running on DD.

    I cannot for the life of me figure out where this one weird extra char is coming from in the script. Can anyone help? I will post a screen cap showing this on my computer if needed...

    {Edit} Hmm, strange... I tested on a different computer also with Chrome but it's okay there! Here is a screenshot, file attached OneChar.jpg of what I am seeing on MY system...
    Last edited by JohnCC; 04-27-2012 at 04:03 PM. Reason: Update with screenshot

  2. #2
    Join Date
    Aug 2004
    Posts
    9,911
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Hmm on my version of Chrome (Win 7) I don't see the extra character either. Does it occur at the end of the message regardless of what the last empty field is? In the screenshot it's after the "age" field...
    DD Admin

  3. #3
    Join Date
    Mar 2007
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    It always occurs at the END, regardless of which field is the last empty one.

    I'm seeing it on an older version of Chrome (12.0.742.91 I believe) that is running as a "Portable App" on my laptop (hence why it has not auto-updated).

    So maybe this is not a problem IF it's just due to my Chrome being out of date. But I'd still like to fix it anyway if possible to do so in MY code, rather than depend on it to be fixed by whatever browser some user may be on in the future.

  4. #4
    Join Date
    Aug 2004
    Posts
    9,911
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    Ok, try changing the line:

    Code:
    alert(alertMsg);
    inside the script to:

    Code:
    alert(alertMsg.replace(/\s*$/, ""));
    It removes any white space from the end of the output message, which that strange block could be one of.
    DD Admin

  5. #5
    Join Date
    Mar 2007
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    That worked... thanks!

    But any downside to this bit of code, i.e. any chance it will cause some worse problem than fixing this little cosmetic quirk?

    Should I use it really OR maybe just leave the script alone and live with the quirk? LOL

    -JC

  6. #6
    Join Date
    Aug 2004
    Posts
    9,911
    Thanks
    3
    Thanked 969 Times in 957 Posts
    Blog Entries
    15

    Default

    There's no potential downside other than the slight overhead in terms of efficiency compared to the original line.
    DD Admin

  7. The Following User Says Thank You to ddadmin For This Useful Post:

    JohnCC (05-03-2012)

  8. #7
    Join Date
    Mar 2007
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    OK, great. Thanks so much for the help

    -JC

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
  •