Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If object variable not set then

Status
Not open for further replies.

QuantumDoja

Programmer
Jun 11, 2004
76
GB
Hi, I am calling an object variable, if it currently does not exist, i need to do some code until it does exist.

For example:

Code:
x = Document.myform.getelementsbytagname("myinput")
If x doesnt exist then
  'perform some loop until it exist.
else
  'carry on
end if

 
Perhaps the IsObject function ? Or a test again Nothing ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hello QuantumDoja,

Use the length property of the HTMLmyinputElement, like this.
[tt]
x = Document.myform.getelementsbytagname("myinput")
If x.length<>0 then
'perform some loop until it exist.
else
'carry on
end if
[/tt]
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top