|
-
Jan 17th, 2001, 09:59 AM
#1
Thread Starter
Hyperactive Member
Hi,
I was wondering what sort of syntax using VBscript would I have to use to check to see if a listbox exists on an html form?
I'm dynamically creating the html page and not all the listboxes may be created.
Thanks in advance.
JazzBass
JazzBass
In the .NET era
Trying to remember VB6
Progress: 
XP Professional @ Home
and @ the Office
-
Jan 17th, 2001, 10:46 AM
#2
Guru
do you want this done on the client or server? If on the client, do you want VBScript or Javascript?
-
Jan 17th, 2001, 10:52 AM
#3
Thread Starter
Hyperactive Member
Thanks,
Thank you,
Would like to do it on the client side, using VBScript.
JazzBass
JazzBass
In the .NET era
Trying to remember VB6
Progress: 
XP Professional @ Home
and @ the Office
-
Jan 17th, 2001, 10:57 AM
#4
Guru
Code:
<html>
<head>
<script language="VBScript">
sub CheckIt()
if isobject(cboURL) then
msgbox("It's here!")
else
msgbox("It's not here!")
end if
end sub
</script>
</head>
<body onclick="CheckIt()">
<select id="cboURL">
<option value="http://www.microsoft.com">Microsoft.com
<option value="http://www.vbforums.com">VB Forums
<option value="http://www.netscape.com">Netscape.com
</select>
</body>
</html>
The code is fired on the onclick event of the document, you can move that to wherever. My point here is to show the use of IsObject to determine whether the object exists or not
Tom
-
Jan 17th, 2001, 11:10 AM
#5
Thread Starter
Hyperactive Member
Thanks, another question
Tom,
Thank you very much. That's looks like it will work great! One last question. Can I use the object's name instead of id to get this to work?
JazzBass
JazzBass
In the .NET era
Trying to remember VB6
Progress: 
XP Professional @ Home
and @ the Office
-
Jan 17th, 2001, 11:14 AM
#6
Guru
Yup, I just tried it out and it works fine
Enjoy!
-
Jan 17th, 2001, 11:18 AM
#7
Thread Starter
Hyperactive Member
Thanks!
Mucho thanks. 
I really appreciate it.
JazzBass
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|