Hi
I have a page written in VBScript, which uses values from a page posted to it, to send an e-mail. The problem is that when I try to specify a control within the page I get an error, saying "Object Required : Document". Here is a piece of the code: -
<%@ Language=VBScript %>
-
<%
-
Dim szMail
-
-
szMail = "<form id= SendAccounting name = SendAccounting language=VBScript>"&_
-
"<table>"&_
-
"<TR>"&_
-
"<TD><STRONG><FONT size = 6; color = #ff3366;>"&"Accounting Instruction"&"</FONT></STRONG>"&_
-
"</TD>"&_
-
"</TR>"&_
-
"<TR>"&_
-
"</TR>"&_
-
"</table>"&_
-
-
-
"<TABLE>" &_
-
"<TR>"&_
-
"<STRONG><FONT color = #ff6666;>" & "Please mark one of the following:" & "</FONT> </STRONG>" &_
-
"</TR>"&_
-
"<TR>"&_
-
"<TD><STRONG>"& "Matching Instruction:" & "</STRONG><INPUT id= chkMatching type= checkbox name= chkMatching> </TD>"&_
-
"<TD><STRONG>"& "Journal:"&"</STRONG></STRONG><INPUT id= chkJournal type= checkbox name= chkJournal> </TD>"&_
-
"<TD><STRONG>"& "Write Off:"&"</STRONG></STRONG><INPUT id= chkWriteOff type= checkbox name= chkWriteOff> </TD>"&_
-
"</TR>"&_
-
"<TR>"&_
-
"</TR>"&_
-
"<TR>"&_
-
"</TR>"&_
-
"</TABLE>"&_
-
"</form>"
-
-
Dim TheForm
-
Set TheForm = document.SendAccounting
-
-
if request.Form("chkMatching")= "on" then
-
SendAccounting.chkMatching1.checked
-
end if
-
The problem occures when I try to reference the control by specifying the document and form that the controls in.
I have also tried Document.forms( o).chkmatching1 , but that doesn'y work either, I get the same error.
Any help will be appreciated.
Thanks
10 2176
try to give an ID to the checkbox (i.e. chkID1) and use
[HTML]document.getEle mentById("chkID 1")[/HTML] to get a reference to it.
Hi
I tried that, though I'm still getting the "Object required: 'document' " error.
Thanks
Hmm, it seems to me that you dont have any document there, just the szMail string with the HTML code, but it is not used anywere?
Yup. As you see I'm dynamically building up the table using script within the "", I've given the form the id, any ideas on the document part of it?
Would you like me to post all the code it's about 400 lines long? I only posted the offending bit.
Question:
Do you can access the form through
[HTML]document.getEle mentById("SendA ccounting")[/HTML]
?
Hi
Tried that as well, still no luck. Getting the same error message.
Thanks
You should be able to access the chkMatching checkbox using
<%Request.Form( "chkMatching")% >
but I'm not sure if you can change its checked state from server on this way.
Ok. I'l give it a go, though the checkbox control is on the same form.
If want to update some controls on client-side, try to use AJAX.
See this small tutorial.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: |
last post by:
I'm trying to create a vbscript so that I can autologin and
get my tasks done unattended. As part of my code, I'm trying
to click to get the vbscript to click the "Login" button but
I'm always getting that error mentioned below. The unusual
thing about it is that the login and password fields are
filled but the line of code where it's supposed to click the
login button returns an error code rather than logging on
to the site. Please help....
|
by: Trevor Fairchild |
last post by:
I'm trying to have VB6 write an html file during run-time, with some
VBScript functionality. The intent is to display images based on the
current record within the program - using a WebBrowser - plus some
buttons to dynamically resize the image.
I have gotten almost everything to work - I put in a function to
simply disable the right-click option of the browser, but none of the
other functions work.
If I copy the source data out of...
|
by: baustin75 |
last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie
only when debugging in php designer 2005
--------------------------------------------------------------------------------
Hello,
I have a very simple problem but cannot seem to figure it out. I have a
very simple php script that sends a test email to myself. When I debug
it in PHP designer, it works with no problems, I get the test email. If
|
by: ChucRock |
last post by:
Hi,
I have the following code where there is some client side VBScript that
does something and needs to pass a variable back to the ASP.NET page.
When the page is updated through a postback, the information is lost.
What am I doing wrong?
After obtaining the variable, I assign it back to a Label text field on
the form, it shows up on the web page no problem.
|
by: Frank |
last post by:
Can I do this?
I add a session var in C# and ultimatly want to pass it into a vbscript
client side activeX control. This is what I have so far but get " Object
Required:'name2' " error.
Can anyone suggest a btter way of passing a session var into a vbscript
function?
<%@ Page language="c#" debug="true" ContentType="text/html"
| |
by: Beemer Biker |
last post by:
I put together a few lines of vbscript so I could dump the contents of a
string to my C drive. It worked fine in a small test.htm where I put the
vbscript at the top of the file. It failed to work (no error message) in my
large program where I needed to dump out the stuff. I did get an error
message from FrontPage 2003 but it was not informative.
When moved the vbscript to the bottom of the page it worked fine!
========start of...
|
by: Dino123 |
last post by:
Hi
I have a page written in VBScript, which uses values from a page posted to it, to send an e-mail. The problem is that when I try to specify a control within the page I get an error, saying "Object Required : Document". Here is a the code:
<%@ Language=VBScript %>
<%
Dim szMail
szMail = "<form id= SendAccounting name = SendAccounting language=VBScript>"&_
"<table>"&_
|
by: tunk |
last post by:
I dont know where to start my question so let me tell you my story :)
The ASP that cause me trouble is running on IIS that set ASP default language to JScript instead of VBScript.
This ASP page is popped up by another ASP page and there are authentication, privilege and security stuff involved. And yes this page contain a lot of javascript.
there is a <DIV></DIV> in this page for me. And my job is as simple as put another page between...
|
by: mudasserrafiq |
last post by:
I am using following asp file default.asp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="0 Days" name=revisit-after>
<META content=info@siderinternational.com name=email>
<META content="Omer Safdar" name=author>
<META content=MegaStudios.com name=publisher>
<META content="Copyright ©2005 - MegaStudios.com" name=copyright>
<SCRIPT...
|
by: xernoth |
last post by:
Hi there,
Just a quick question. I'm more familiar with C# and ASP.NET but need
to use ASP/VBScript for a quick project.
I have a form that uploads content to a server not managed by us. When
the form is filled in and posted, the response from the server is an
XML response. However when that happens, I'm not longer at my asp
page, I'm redirected the XML response URL that's managed by the third
party server.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |