By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 3,120 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

Problem using Jscript Object getElementById

P: 25
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
Expand|Select|Wrap|Line Numbers
  1.  
  2. document.getElementById(currenthighlight).style.backgroundColor= "#ffffff";
  3.  
  4.  
.

Any help would be appreciated.


Expand|Select|Wrap|Line Numbers
  1.  
  2. function SelectRow(rownum,key1,key2,type)
  3.                 {
  4.                     var currenthighlight = document.forms[0].highlightedrow.value;
  5.  
  6.                     if (currenthighlight == "" )
  7.                     {
  8.                         document.getElementById(rownum).style.backgroundColor= "#E6E6FA";
  9.                         document.forms[0].highlightedrow.value = rownum;
  10.                     }
  11.                     else
  12.                     {
  13.         ------>                document.getElementById(currenthighlight).style.backgroundColor= "#ffffff";
  14.                         document.getElementById(rownum).style.backgroundColor= "#E6E6FA";
  15.                         document.forms[0].highlightedrow.value = rownum;
  16.                     }
  17.  
  18.     ...........................
  19.     ...........................
  20.                 }    
Jan 8 '08 #1
Share this Question
Share on Google+
2 Replies


100+
P: 428
excuse me. I mis-posted.
Jan 8 '08 #2

100+
P: 428
have your function alert (document.forms[0].highlightedrow.value) .
Jan 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.