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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form elements ?

Status
Not open for further replies.

onpnt

Programmer
Dec 11, 2001
7,778
US
I tried a very simple client side script while messing around and I ran into something that I can't explain and can't get to work. This is about the simplest script you'll ever see, but it does not work and I really want to know why.
Browser maybe?? (running IE5)
All I'm doing is counting the form elements and putting them in a alert. Always gives me object does not support this property or method.
<HTML>
<HEAD>
<TITLE>Forms and Elements</TITLE>
<SCRIPT LANGUAGE=&quot;VBScript&quot;>
Sub cmdTest_OnClick

alert document.form1.elements.count

End Sub
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME=&quot;form1&quot;>
<INPUT TYPE=&quot;TEXT&quot;><P>
<INPUT TYPE=&quot;TEXT&quot;><P>
<INPUT TYPE=&quot;TEXT&quot;><P>
<INPUT TYPE=&quot;TEXT&quot;><P>
<INPUT TYPE=&quot;TEXT&quot;><P>
<INPUT TYPE=&quot;BUTTON&quot; NAME=&quot;cmdTest&quot; VALUE=&quot;Test!&quot;>
</FORM>
</HTML>

Thanks I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
this object does not support property or method

document.form1.elements.count I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
The name of the property is Length, not count.

alert document.form1.elements.Length Jon Hawkins
 
ouch! that's embarrassing.
Thanks jonscott8 I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top