Disabled property issue with JS objects

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JohnIdol
    New Member
    • Apr 2007
    • 21

    Disabled property issue with JS objects

    Hi All,

    I am using this funcion to manipulate form elements;
    every thing works fine except the reference to the disabled property.

    Any help (the property works fine when used in classic manner)?

    Thanks!

    G

    function getObj(name)
    {
    if (document.getEl ementById)
    {
    this.obj = document.getEle mentById(name);
    this.style = document.getEle mentById(name). style;
    this.disabled = document.getEle mentById(name). disabled;
    }
    else if (document.all)
    {
    this.obj = document.all[name];
    this.style = document.all[name].style;
    this.disabled = document.all[name].disabled;
    }
    else if (document.layer s)
    {
    this.obj = document.layers[name];
    this.style = document.layers[name];
    this.disabled = document.layers[name].disabled;
    }
    }
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    I can only assume that you're trying to access an object which doesn't support the disabled property.

    Comment

    Working...