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
Printable View
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
do you want this done on the client or server? If on the client, do you want VBScript or Javascript?
Thank you,
Would like to do it on the client side, using VBScript.
JazzBass
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 notCode:<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>
Tom
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
Yup, I just tried it out and it works fine
Enjoy!
Mucho thanks. :D
I really appreciate it.
JazzBass