SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2004
    Location
    australia
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simple script not working in firefox

    hi everyone

    i'm not a javascript guru but this simple value check and pop up alert does not work in firefox or netscape..works fine in IE

    what am i doing wrong??

    function z_check_value()
    {
    zstatus = document.all["SET.status"].value;

    if (zstatus == 'RE' || zstatus == '')
    {
    if (document.all["SET.alg.description"].value == "")
    {
    alert("alert message here");
    return false;
    }
    }

    return true;
    }

    thnx

    tonym

  2. #2
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what am i doing wrong??
    You're using the microsoft-proprietary document.all collection. Look at using the standardised document.getElementById() instead.

    If you post all the code here (including the HTML) someone will probably be able to provide more detailed help.

  3. #3
    SitePoint Wizard silver trophy Crazybanana's Avatar
    Join Date
    Mar 2003
    Location
    In tha fruit cellar
    Posts
    1,379
    Mentioned
    32 Post(s)
    Tagged
    1 Thread(s)
    yeah, it works fine in IE because document.all is an IE only "standard" if i can put it that way hehe, but it should be quite simple to rewrite it so it uses the standardised
    document.getElementById('name') so do as bluefive said and put all your code here and we will be able to provide you more help
    Who's to doom when the judge himself is dragged before the bar



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
  •