473,387 Members | 1,516 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,387 software developers and data experts.

Determine If Object Exist

I have a script that will set the focus to a particular input box. I
want the script to check to see if the input box exist also.

I'm receiving the following error:
'document.ScheduleForm.txtGrossPayroll99' is null or not an object.

The txtGrossPayroll99 is a field that does not exist. I've hard-coded
this name into the script to see if it is working correctly.
I'm using the OnLoad event inside the <Body> tag to execute this
function.
var formInUse = false;
function setFocus()
{
if ((!formInUse) && (typeof(document.ScheduleForm.txtGrossPayroll99) !=
"undefined") && (typeof(document.ScheduleForm.txtGrossPayroll99) !=
null) );{
document.ScheduleForm.txtGrossPayroll99.focus();
}
}

Can someone tell me what I'm doing wrong?

Thanks,
CR Junk

Jul 23 '05 #1
6 6302
> "crjunk" <cr****@earthlink.net> wrote:
news:11**********************@g44g2000cwa.googlegr oups.com....

I have a script that will set the focus to a particular input box. I
want the script to check to see if the input box exist also.

I'm receiving the following error:
'document.ScheduleForm.txtGrossPayroll99' is null or not an object.

The txtGrossPayroll99 is a field that does not exist. I've hard-coded
this name into the script to see if it is working correctly.
I'm using the OnLoad event inside the <Body> tag to execute this
function.
var formInUse = false;
function setFocus()
{
if ((!formInUse) && (typeof(document.ScheduleForm.txtGrossPayroll99)
!= "undefined") && (typeof(document.ScheduleForm.txtGrossPayroll99) !=
null) );{
document.ScheduleForm.txtGrossPayroll99.focus();
}
}

Can someone tell me what I'm doing wrong?

Thanks,
CR Junk


/*If ScheduleForm true check for txtGrossPayroll99*/
if(document.ScheduleForm){
/*If txtGrossPayroll99 true alert yup*/
if(document.ScheduleForm.txtGrossPayroll99){alert( 'yup')}
/*Esle if txtGrossPayroll99 false alert nope*/
else if(!document.ScheduleForm.txtGrossPayroll99){alert ('nope')}
}
/*If SCheduleForm false alert No form to check*/
else if(!document.ScheduleForm){alert('No form to check')}

--
BootNic Tuesday, July 05, 2005 5:57 PM

I try to take one day at a time, but sometimes several days attack me at once.
*Jennifer Unlimited*

Jul 23 '05 #2
Thanks for your help. By adding the "if
(document.ScheduleForm.txtGr*ossPayroll99)" piece of code, my function
now works correctly.

CR Junk

Jul 23 '05 #3
JRS: In article <Wn***************@newssvr31.news.prodigy.com>, dated
Tue, 5 Jul 2005 21:58:14, seen in news:comp.lang.javascript, BootNic
<Bo*****@bounce.prodigy.net> posted :

BootNic Tuesday, July 05, 2005 5:57 PM


In an international medium, giving the time to the minute is rather
pointless unless you also give the offset from GMT/UTC. Don't use a TLA
for that; BST has at least three meanings.

Presumably your offset is in the range -4 to -9 hours, since you give an
FFF-compatible time.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 23 '05 #4
Dr John Stockton wrote:
JRS: In article <Wn***************@newssvr31.news.prodigy.com>, dated
Tue, 5 Jul 2005 21:58:14, seen in news:comp.lang.javascript, BootNic
<Bo*****@bounce.prodigy.net> posted :
BootNic Tuesday, July 05, 2005 5:57 PM

In an international medium, giving the time to the minute is rather
pointless unless you also give the offset from GMT/UTC.


Even then it is pointless, except to people who like to be pedantic
about the minutes.

Don't use a TLA for that; BST has at least three meanings.
EST probably has more than that......
Presumably your offset is in the range -4 to -9 hours, since you give an
FFF-compatible time.


Making assumptions again?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #5
JRS: In article <aZ********************@comcast.com>, dated Wed, 6 Jul
2005 18:16:22, seen in news:comp.lang.javascript, Randy Webb
<Hi************@aol.com> posted :
Dr John Stockton wrote:

Don't use a TLA for that; BST has at least three meanings.


EST probably has more than that......


Chronologically, only Eastern Standard Time, as far as I know - in
America and in Australia. Anyone know, for certain, of any others? It
also has a meaning in Latin and French, at least.

Presumably your offset is in the range -4 to -9 hours, since you give an
FFF-compatible time.


Making assumptions again?


When the context implies nothing about time-of-day, few other than
Americans would use the 12-hour clock to state the time-of-day in an
international technical communication medium. The hypothesis is
supported by his use of prodigy.net, an organisation unwise enough to
put NNTP-Posting-Date: Tue, 05 Jul 2005 17:58:14 ETD in his header.

Americans find it hard to understand exactly how silly and parochial the
rest of the world finds them to be. How much foreign travel (not
counting in Canada, if any) did your present President do in the Second
Millennium?

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 23 '05 #6
Dr John Stockton wrote:
JRS: In article <aZ********************@comcast.com>, dated Wed, 6 Jul
2005 18:16:22, seen in news:comp.lang.javascript, Randy Webb
<Hi************@aol.com> posted :
Dr John Stockton wrote:
Don't use a TLA for that; BST has at least three meanings.


EST probably has more than that......

Chronologically, only Eastern Standard Time, as far as I know - in
America and in Australia.


Just because you don't know doesn't mean they don't exist, hence my use
of the word "probably", but it's irrelevant.
Anyone know, for certain, of any others? It
also has a meaning in Latin and French, at least.
Presumably your offset is in the range -4 to -9 hours, since you give an
FFF-compatible time.
Making assumptions again?

When the context implies nothing about time-of-day, few other than
Americans would use the 12-hour clock to state the time-of-day in an
international technical communication medium.


The context I read what you replied to, which was a signature, was
indeed a time of day, but you chose to read it the way you wanted to
read it. That's your choice but it doesn't make you right.

The hypothesis is supported by his use of prodigy.net, an organisation
unwise enough to put NNTP-Posting-Date: Tue, 05 Jul 2005 17:58:14 ETD
in his header.
The problem with the support of your hypothesis is an incorrect
assumption. I am sure you can find the incorrect assumption.

Americans find it hard to understand exactly how silly and parochial the
rest of the world finds them to be.
And the rest of the world finds it hard to understand why most Americans
don't care what the rest of the world thinks.

How much foreign travel (not counting in Canada, if any) did your present
President do in the Second Millennium?


What this has to do with the date/time stamp in a signature totally
eludes me, but, I will answer you anyway even though I know it's nothing
more than an attempt by you to display your blatantly anti-US attitude.

An exact answer, I do not know and I do not care. An educated guess?
Probably more times than the Queen Mother depended on the US to save her
crown in the last 100 years.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: JT | last post by:
is there a way to determine if a form object actually exists? if i use the following syntax: varTextField = Request.Form("txtFormField") then varTextField = "" which gives the same result...
2
by: LaBird | last post by:
Dear all, I'd like to know if there is any function or program call in C++ (without memory protection support by OS), that can determine whether an object is being read or written? e.g., a =...
0
by: Dirk Försterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). ...
2
by: Edward | last post by:
I have the following function to determine if a form is loaded: Public Function modIsloaded(ByVal vstrFormName As String) As Boolean ' Error handling removed for concision ' Determine if...
1
by: Top Gun | last post by:
I have a DataSet containing a Parent/Child relationship that has been populated by Sql Server. I have an expectation that certain child records should exist for each parent based upon column data....
9
by: Adam | last post by:
Can someone please help!! I am trying to figure out what a font is? Assume I am working with a fixed font say Courier 10 point font Question 1: What does this mean 10 point font Question 2:...
8
by: ST | last post by:
Hello everyone, Can anyone help me with this error above when I debug my web app project in vstudio.net?? I can't figure it out! It was working fine for months, and now all of a sudden it's not!!...
3
by: Developer in California | last post by:
I am working on developing a generic Web framework using Master Pages in ASP.NET 2.0. What I have done is created a PageRenderer class which has a public method which will retrieve the path of the...
1
by: orp | last post by:
We've been struggling on how to determine if a local user is already in a local group. We have code (C#) that creates a local user, if the user doesn't already exist. And, we have code (C#) that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.