473,388 Members | 1,939 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,388 software developers and data experts.

ASP object required error - vbscript

Dear Group
I am trying to use the following code to refer to a form and control on my
form. I am supposed to be using VBSCRIPT for this code.
I always get an "object required: 'document' " error:

<%
Dim Myform
Set Myform = document.forms.thisform
Myform.textbox1.value = "fish" %>

None of this code will work. Always get an error.
Using Visual Interdev, plain ole ASP, and vbscript, and Win XP Pro with IIS
5.1

What am I missing or doing wrong???

Thanks

eric


Jul 19 '05 #1
3 8029
> <%
Dim Myform
Set Myform = document.forms.thisform


You are seriously confusing client-side and server-side concepts. ASP
executes as, basically, a two-step process. ASP runs on the server, and so
has no knowledge of client-side things like forms. Once ASP finishes
running, the client-side code runs and, likewise, it has no knowledge of
server-side subs, functions, etc. Think about getting a passport, you need
to get your photo first, then apply for the passport. Does it make sense to
have your passport # printed on the photo before your passport # has been
issued?

You can make the two communicate in different ways, but what you're doing
isn't one of them.

To replicate what you're trying to do:

<%
myValue = "fish"
%>
<input type=text name=textbox1 value='<%=myValue%>'>

Not sure why you are "supposed to be using VBScript" ... you should use
JavaScript on the client so that your pages will work in Firebird/Firefox,
Mozilla, etc.

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #2
On Mon, 9 Aug 2004 10:04:00 -0700, "News Groups"
<eh*******@verizon.net> wrote:
Dear Group
I am trying to use the following code to refer to a form and control on my
form. I am supposed to be using VBSCRIPT for this code.
I always get an "object required: 'document' " error:

<%
Dim Myform
Set Myform = document.forms.thisform
Myform.textbox1.value = "fish" %>

None of this code will work. Always get an error.
Using Visual Interdev, plain ole ASP, and vbscript, and Win XP Pro with IIS
5.1

What am I missing or doing wrong???


Mixing VBScript and Javascript with something I can't identify...

You haven't created a Myform object is what's likely causing the
error, but I have no idea why you would want to. What exactly are you
trying to accomplish?

Jeff
Jul 19 '05 #3
Document is a client-side object supplied by the browser to the local
scripting environment. You are trying to use it in server side code.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"News Groups" <eh*******@verizon.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Dear Group
I am trying to use the following code to refer to a form and control on my
form. I am supposed to be using VBSCRIPT for this code.
I always get an "object required: 'document' " error:

<%
Dim Myform
Set Myform = document.forms.thisform
Myform.textbox1.value = "fish" %>

None of this code will work. Always get an error.
Using Visual Interdev, plain ole ASP, and vbscript, and Win XP Pro with IIS 5.1

What am I missing or doing wrong???

Thanks

eric

Jul 19 '05 #4

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

Similar topics

3
by: Apostolis K. | last post by:
At first I make a independend virtual directory wich I named app and I check Directory Browsing in the Virtual Directory Properties. Then I create with notepad global.asa and index.asp ...
4
by: Oli | last post by:
Hi Hope someone can help: <% set rsProdInfo = Server.CreateObject("ADODB.Recordset") rsProdInfo.Open "TBL_Products", Conn intTotal = 0
1
by: Carolyn Speakman | last post by:
Hi, I'm trying to amend an intranet .asp page but keep getting this error. The error only occurs when I pull the WHOLE intranet off the server and try to run it locally. The error isn't there...
13
by: Patrick | last post by:
I understand that with IIS5.1 on Windows XP Professional SP1, I can 1) Either set under IIS Manager-> Any specific Virtual Directory-> Configuration->Options->ASP Script timeout for all pages...
6
by: Steve Richter | last post by:
I am getting error in a vbscript: ActiveX component cant create object: Excel.Application. The vbscript code is: Dim objExcel Set objExcel = CreateObject("Excel.Application") I am pretty...
7
by: google | last post by:
I am trying to use the following ASP code to examine the file names in a folder: Dim fso, f, fl, s, fs Set fso = CreateObject("Scripting.FileSystemObject") Set f =...
7
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function Body_Onload() ' create the object Set obj = Server.CreateObject("UploadImage.cTest") ' use method of the object...
0
by: Jennifer.Berube | last post by:
So I setup my code finally got the connection string (include utility.asp file) thanks to one of ya'll on here and now I have a new problem... This is the error I'm getting: Error Type:...
4
by: Genken | last post by:
Hi can anybody help me i get this error when running this code. Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '' And then a line number indicating where the error is, i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.