Problem using Jscript Object getElementById

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arizal
    New Member
    • Feb 2007
    • 25

    #1

    Problem using Jscript Object getElementById

    Hello Frens,
    I am having problem with the following Javascript using in IE. Firefox does not shows any problem and i have no idea where it went wrong in this code. It returns an error : Object required at the line
    [CODE=javascript]

    document.getEle mentById(curren thighlight).sty le.backgroundCo lor= "#ffffff";

    [/CODE].

    Any help would be appreciated.


    [CODE=javascript]

    function SelectRow(rownu m,key1,key2,typ e)
    {
    var currenthighligh t = document.forms[0].highlightedrow .value;

    if (currenthighlig ht == "" )
    {
    document.getEle mentById(rownum ).style.backgro undColor= "#E6E6FA";
    document.forms[0].highlightedrow .value = rownum;
    }
    else
    {
    ------> document.getEle mentById(curren thighlight).sty le.backgroundCo lor= "#ffffff";
    document.getEle mentById(rownum ).style.backgro undColor= "#E6E6FA";
    document.forms[0].highlightedrow .value = rownum;
    }

    ............... ............
    ............... ............
    } [/CODE]
  • mrhoo
    Contributor
    • Jun 2006
    • 428

    #2
    excuse me. I mis-posted.

    Comment

    • mrhoo
      Contributor
      • Jun 2006
      • 428

      #3
      have your function alert (document.forms[0].highlightedrow .value) .

      Comment

      Working...