document.getElementById not working in Mozilla firefox

Discussion in 'JavaScript' started by MrFoz64, May 12, 2008.

  1. #1
    Hi

    he following works in ie but not firefox

    // Glass pattern
    var glasspat = document.getElementById("glass").value;
    document.budgetform.GlassPattern.value=glasspat;

    Any ideas why

    Cheers
     
    MrFoz64, May 12, 2008 IP
  2. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #2
    Are you getting any errors in your console?
     
    crath, May 12, 2008 IP
  3. hotmarket

    hotmarket Peon

    Messages:
    64
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Pls check whether here have reduplicate id or your define and your call is same!
     
    hotmarket, May 12, 2008 IP
  4. gamini2006

    gamini2006 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I also get the same thing.
    In my case it give this Error message
    "ErrorType : document.getElementById("catid") has no properties"

    Plz giv me a help
    Thx
     
    gamini2006, May 14, 2008 IP
  5. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #5
    Make sure this javascript is running AFTER the html has generated the objects on your page. This will make the object have no properties!
     
    crath, May 14, 2008 IP
  6. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #6
    It means the JS can not find the object with "catid" ID.
     
    xrvel, May 14, 2008 IP
  7. gamini2006

    gamini2006 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Ya
    I resolve the prb.
    I hvnt given the object ID (ID = "catid")

    thx to all
     
    gamini2006, May 15, 2008 IP