I have the following code:

<Script LANGUAGE=vbscript RUNAT=Server>

for i =0 to document.form1.elements.count-1

response.write "test"

next

</Script>

When it gets to the line for i=0.... the error message pops up stating that
Object does not support this Property or Method.



I have a from name form1.



Please help.

Re: Object Does not support this property or Method error by Curt_C

Curt_C
Mon Jan 26 16:06:45 CST 2004

it's because the server doesn't know what
document.form1.elements.count
is, that's my bet.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


"Roberta McGervey" <ramcgervey@atc-nec.com> wrote in message
news:OkjdJXF5DHA.1632@TK2MSFTNGP12.phx.gbl...
> I have the following code:
>
> <Script LANGUAGE=vbscript RUNAT=Server>
>
> for i =0 to document.form1.elements.count-1
>
> response.write "test"
>
> next
>
> </Script>
>
> When it gets to the line for i=0.... the error message pops up stating
that
> Object does not support this Property or Method.
>
>
>
> I have a from name form1.
>
>
>
> Please help.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



Re: Object Does not support this property or Method error by Stuart

Stuart
Tue Jan 27 04:02:40 CST 2004

Looks like you are mixing Javascript with VBScript IMHO.

Stuart


"Roberta McGervey" <ramcgervey@atc-nec.com> wrote in message
news:OkjdJXF5DHA.1632@TK2MSFTNGP12.phx.gbl...
> I have the following code:
>
> <Script LANGUAGE=vbscript RUNAT=Server>
>
> for i =0 to document.form1.elements.count-1
>
> response.write "test"
>
> next
>
> </Script>
>
> When it gets to the line for i=0.... the error message pops up stating
that
> Object does not support this Property or Method.
>
>
>
> I have a from name form1.
>
>
>
> Please help.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



Re: Object Does not support this property or Method error by Roberta

Roberta
Tue Jan 27 07:38:58 CST 2004

I got the following code from MSDN to use as an example. So if I am mixing
to two languages it is because the MSDN is incorrect.

<SCRIPT LANGUAGE="VBScript">
<!-
Sub cmdChange_OnClick
For i=0 To Document.frmForm.Elements.Count-1
Document.frmForm.Elements(i).Value="Changed!"
Next
End Sub
->
</SCRIPT>


"Stuart" <stuart@nowhere.co.uk> wrote in message
news:%23R1l%23xL5DHA.2692@TK2MSFTNGP09.phx.gbl...
> Looks like you are mixing Javascript with VBScript IMHO.
>
> Stuart
>
>
> "Roberta McGervey" <ramcgervey@atc-nec.com> wrote in message
> news:OkjdJXF5DHA.1632@TK2MSFTNGP12.phx.gbl...
> > I have the following code:
> >
> > <Script LANGUAGE=vbscript RUNAT=Server>
> >
> > for i =0 to document.form1.elements.count-1
> >
> > response.write "test"
> >
> > next
> >
> > </Script>
> >
> > When it gets to the line for i=0.... the error message pops up stating
> that
> > Object does not support this Property or Method.
> >
> >
> >
> > I have a from name form1.
> >
> >
> >
> > Please help.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>



Re: Object Does not support this property or Method error by Roberta

Roberta
Tue Jan 27 07:43:24 CST 2004

I'm new to this so is there a setting on the web server I can change so that
it recognizes this statement?

I found a different way to do what I want to do but it would require more
code. From the interdev and vbscript courses I took online this statment
should work.

Thanks.
"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ueqbRhF5DHA.1936@TK2MSFTNGP12.phx.gbl...
> it's because the server doesn't know what
> document.form1.elements.count
> is, that's my bet.
>
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> www.Darkfalz.com
>
>
> "Roberta McGervey" <ramcgervey@atc-nec.com> wrote in message
> news:OkjdJXF5DHA.1632@TK2MSFTNGP12.phx.gbl...
> > I have the following code:
> >
> > <Script LANGUAGE=vbscript RUNAT=Server>
> >
> > for i =0 to document.form1.elements.count-1
> >
> > response.write "test"
> >
> > next
> >
> > </Script>
> >
> > When it gets to the line for i=0.... the error message pops up stating
> that
> > Object does not support this Property or Method.
> >
> >
> >
> > I have a from name form1.
> >
> >
> >
> > Please help.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>



Re: Object Does not support this property or Method error by Curt_C

Curt_C
Tue Jan 27 07:52:59 CST 2004

that is CLIENTSIDE code though, not SERVER

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


"Roberta McGervey" <ramcgervey@atc-nec.com> wrote in message
news:eDhbvrN5DHA.2740@TK2MSFTNGP09.phx.gbl...
> I got the following code from MSDN to use as an example. So if I am
mixing
> to two languages it is because the MSDN is incorrect.
>
> <SCRIPT LANGUAGE="VBScript">
> <!-
> Sub cmdChange_OnClick
> For i=0 To Document.frmForm.Elements.Count-1
> Document.frmForm.Elements(i).Value="Changed!"
> Next
> End Sub
> ->
> </SCRIPT>
>
>
> "Stuart" <stuart@nowhere.co.uk> wrote in message
> news:%23R1l%23xL5DHA.2692@TK2MSFTNGP09.phx.gbl...
> > Looks like you are mixing Javascript with VBScript IMHO.
> >
> > Stuart
> >
> >
> > "Roberta McGervey" <ramcgervey@atc-nec.com> wrote in message
> > news:OkjdJXF5DHA.1632@TK2MSFTNGP12.phx.gbl...
> > > I have the following code:
> > >
> > > <Script LANGUAGE=vbscript RUNAT=Server>
> > >
> > > for i =0 to document.form1.elements.count-1
> > >
> > > response.write "test"
> > >
> > > next
> > >
> > > </Script>
> > >
> > > When it gets to the line for i=0.... the error message pops up stating
> > that
> > > Object does not support this Property or Method.
> > >
> > >
> > >
> > > I have a from name form1.
> > >
> > >
> > >
> > > Please help.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>



Re: Object Does not support this property or Method error by Bob

Bob
Tue Jan 27 07:57:17 CST 2004

Roberta McGervey wrote:
> I'm new to this so is there a setting on the web server I can change
> so that it recognizes this statement?

No. "document" is a client-side DHTML object. Server-side code knows nothing
about client-side DHTML.

>
> I found a different way to do what I want to do but it would require
> more code. From the interdev and vbscript courses I took online this
> statment should work.

Then you need to reread those sources. You can never reference a client-side
object or property from server-side code, and vice versa.
Your code would work fine if you removed the "RUNAT=Server" piece from the
script tag.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Re: Object Does not support this property or Method error by Bob

Bob
Tue Jan 27 10:47:07 CST 2004

Roberta McGervey wrote:
> I got the following code from MSDN to use as an example. So if I am
> mixing to two languages it is because the MSDN is incorrect.

No, it's because your code is incorrect.

MSDN's code:
>
> <SCRIPT LANGUAGE="VBScript">

Your code:
>> <Script LANGUAGE=vbscript RUNAT=Server>

See the difference?

Actually, Stuart was incorrect: you are not mixing two languages. Your
mistake is attempting to use a server-side script block (RUNAT=Server) to
run code that can only run on the client.

This is the main obstacle to people attempting to learn to use asp (myself
included): learning the difference between server-side code and client-side
code. There are many asp tutorial sites out there (www.asp101.com, etc.)
that do a reasonable job of explaining the differennce better than i can do
in an email message.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.