473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

"empid" is undefined or null

hi,

I am developing on a Payroll system and using Jsp/servlet technology. For this I have created a Employee Information Page which has three buttons Add Employee Information , Modifiy Employee Information and Delete Employee Information.

There is a JavaScript function which executes on BODY tag's onload function.
// -- <body onload="funAdd()" --//

function funAdd()
{


document.form1.addbutton.disabled=false;
document.form1.updatebutton.disabled=true;
document.form1.deletebutton.disabled=true;
empid.style.display='block';
cmb.style.display='none';
}

As you can see that on body load the rest two buttons should be disabled.

Again I have two more contorl in the form one TextField and one Combo. And I am using stylesheet to hide the combo using its id,which is cmb. Same thing happen when I am slecting update button, it calls a function funUpdate and hide the textbox and displays combo with al the employee id present in my database.

the code is

<div id="empid" style="display:block"> <input name="txtempid" type="text"></div>

//-- you can see the code written belwo populating data from JSP session --//

<div id="cmb" style="display:none">
<select name="select" id="selectValue" onChange="updateDeleteRecord();">
<%
ArrayList empArr = (ArrayList) session.getAttribute("fetchEmpId");
Iterator it=empArr.iterator();
while (it.hasNext())
{
String empidStr=(String)it.next();
%>
<option value=<%=empidStr%>><%=empidStr%></option>
<%
}
%>
</select>
</div>

Now the problem when I running this application in my home PC it runs very well but when I install this in our client machine, only 25% page displays and a javascript message comes in status bar -- empid is undefined or not an object.

What I did, removed all javascript and then added one by one. then again the page executed.

Now again I taken this modified page to other machine it started giveing same again...

Page stops exactly two line before the Jsp code...(which is fetching data form session)

I am frusted and searching on google from two days .... as I dont understand any problem here so i am also not able to find out the problem

Client is using IE 6.0

Please help me, what should I do...

If I am not clear then Please write, I will try to explain in more detail
Jun 4 '07 #1
2 1951
drhowarddrfine
7,435 Expert 4TB
You are getting an error about a css id, it's still a javascript error. I'm sending you there.
Jun 4 '07 #2
iam_clint
1,208 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. empid.style.display='block';
  2. cmb.style.display='none';
  3.  
its because these two items are not defined anywhere.

do this
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("empid").style.display='block';
  2. document.getElementById("cmb").style.display='none';
  3.  
Jun 4 '07 #3

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

Similar topics

4
by: Chad Micheal Lawson via .NET 247 | last post by:
I'm stumped at this point and I'm tired of trying things so I'mposting in hopes of some guru with a sharp eye. I have anasp.net app running on a local Win XP Pro box. Within the app,I call a SPROC...
3
by: ciaran.mchale | last post by:
Hi folks, I downloaded the binary version of Xerces C++ 2.7.0 for Windows and am using it to help me get up to speed with XML and XML Schema. So please excuse me if this is a "novice" question....
2
by: Bob Stearns | last post by:
I thought that the given expression was always TRUE if "not_there" wasn't among the keys (or subscripts if you will) of $_SESSION. Below find a dump of $_SESSION, a small snippet of code and the...
60
by: Dave | last post by:
I'm never quite sure whether to use "this." or not when referring to fields or properties in the same class. It obviously works just fine without it but sometimes I wonder if using this....
4
by: Bob | last post by:
I have an Access application where I need to automatically forward emails to a group of 12 salespeople as soon as they arrive. The first email needs to go to the first salesperson on the list, the...
3
by: Frank Milverckowitz | last post by:
Hi, Newbie question about SqlDataReader column value access... In java jdbc code to get a value from a table column we can pass the column name (instead of an int index or offset): String...
12
by: sandyw | last post by:
Exception in thread "main" java.lang.NullPointerException at company.Employee.inputEmployee(Employee.java:172) at company.Employee.main(Employee.java:267) which I got before... Can someone please...
0
by: Gwen Crutcher | last post by:
I keep getting the error "No value given for one or more required parameters", but not sure why. Can anyone please look at my code snipet and see if you see any reason why I could be getting this...
3
by: gavm360 | last post by:
Hello, I'm making a data entry form that i would like to have display the operators name. So far i have a preceeding "Login" form in which the operator inputs his/her employee number into a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.