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

What does "member not found" error mean?

100+
P: 110
I want input objects to have a light yellow background when they have focus. Here's how I call my function:

Expand|Select|Wrap|Line Numbers
  1. input name="monthsVacant" id="monthsVacant" disabled="disabled" onFocus="yellowOn('monthsVacant')"
  2.  
And here's my function.

Expand|Select|Wrap|Line Numbers
  1. function yellowOn(vObject){
  2.  var vObject; //object being highlighted
  3.  document.getElementById(vObject).style="background-color:#FFFFCC";
  4.  
When the object gets focus I get an error message that says "member not found". What is it talking about? And how can I get this to work?
Jan 15 '09 #1
Share this Question
Share on Google+
3 Replies


Dormilich
Expert Mod 5K+
P: 8,639
you are overwriting the function's argument, omit line #2. further, the background colour in JS can be accessed by style.backgroundColor.

nevertheless, a much easier approach would be using the this keyword:
Expand|Select|Wrap|Line Numbers
  1. function myfunction()
  2. {
  3.   this.style.color = "red";
  4. }
Jan 15 '09 #2

100+
P: 110
Expand|Select|Wrap|Line Numbers
  1. function yellowOn(vObject){ 
  2. document.getElementById(vObject).style="background-color:#FFFFCC"; 
  3.  
which results in "member not found"

and

Expand|Select|Wrap|Line Numbers
  1. function yellowOn(vObject){ 
  2. document.getElementById(vObject).style.backgroundcolor="#FFFFCC"; 
  3.  
which results in nothing at all
Jan 15 '09 #3

Dormilich
Expert Mod 5K+
P: 8,639
@andersond
JS is case sensitive, the property is called "backgroundColor"
Jan 16 '09 #4

Post your reply

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