473,320 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Object Does not support this property or Method error

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.







Jul 19 '05 #1
7 4993
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" <ra********@atc-nec.com> wrote in message
news:Ok**************@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.







Jul 19 '05 #2
Looks like you are mixing Javascript with VBScript IMHO.

Stuart
"Roberta McGervey" <ra********@atc-nec.com> wrote in message
news:Ok**************@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.







Jul 19 '05 #3
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" <st****@nowhere.co.uk> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Looks like you are mixing Javascript with VBScript IMHO.

Stuart
"Roberta McGervey" <ra********@atc-nec.com> wrote in message
news:Ok**************@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.








Jul 19 '05 #4
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:ue**************@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" <ra********@atc-nec.com> wrote in message
news:Ok**************@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.








Jul 19 '05 #5
that is CLIENTSIDE code though, not SERVER

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"Roberta McGervey" <ra********@atc-nec.com> wrote in message
news:eD**************@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" <st****@nowhere.co.uk> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Looks like you are mixing Javascript with VBScript IMHO.

Stuart
"Roberta McGervey" <ra********@atc-nec.com> wrote in message
news:Ok**************@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.









Jul 19 '05 #6
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.
Jul 19 '05 #7
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.
Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: shank | last post by:
Can anyone give me some general ideas on why an error like Object doesn't support this property or method: 'ZoneRS.MoveFirst' comes up on a page? MoveFirst is a command to move to the first...
3
by: news.onetel.net.uk | last post by:
I and my friend Karl have spent literally all day trying to find out what is causing my error but we are zapped of any further functionality :) I have a form that adds news records. You select...
54
by: tshad | last post by:
I have a function: function SalaryDisplay(me) { var salaryMinLabel = document.getElementById("SalaryMin"); salaryMinLabel.value = 200; alert("after setting salaryMinLabel = " +...
0
by: fniles | last post by:
I created a CAB file for a 3rd party control (StockChartX) it using CABARC.exe that comes from Microsoft SDK. In the CAB file I included the StockChartX.ocx and StockChartX.INF. Then, I signed the...
7
by: stellstarin | last post by:
hi all, I have a HTML page with two forms. While trying to add a hidden element in a first form by the default javascript function, the error message 'object does not support this property or...
5
by: John Olbert | last post by:
Subject: Error is Object doesn't support this property or method I am trying to pass a C# string under Vs2005 (Net2) to an Vb6 ActiveX Control. I get the following runtime error-- "Object...
2
by: Ralph | last post by:
Hi I don't understand why it's not working: function schedule(imTop){ this.tdImagesTop = imTop; } schedule.prototype.selectEl = function() { alert(this.tdImagesTop);
8
by: Kevin Blount | last post by:
I'm tyring to access an object created by using a method from a third party API. The documentation tells me what object should be return, and the properties of that object, but when I try and...
0
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the...
2
by: thj | last post by:
Hi. I've got this form that I'm trying to validate: <form id="periodForm" action="" method="post"> <p> Periode: <input id="startDate" name="startDate" type="text" size="7" value="<%=...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.