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

runtime error: object doesn't support this property or method

I tried to display all html control types in the form. But it has run
time error
"object doesn't support this property or method" on
document.write(obj.type);

Even I do document.write('hello world'); it still has the same error.
function clearForm()
{ var i=0;
for (i=0; i<InputForm.elements.length-1; i++)
{ var obj = InputForm.elements[i];
document.write(obj.type); //runtime error: object doesn't support
this property or method
}
}

any ideas?? thanks!!
Jul 23 '05 #1
3 3439
Lee
Matt said:

I tried to display all html control types in the form. But it has run
time error
"object doesn't support this property or method" on
document.write(obj.type);

Even I do document.write('hello world'); it still has the same error.
function clearForm()
{ var i=0;
for (i=0; i<InputForm.elements.length-1; i++)
{ var obj = InputForm.elements[i];
document.write(obj.type); //runtime error: object doesn't support
this property or method
}
}


Don't use document.write() for debugging. As soon as you write
anything to a document that has already been displayed, you
clear the current contents. That means that on the second time
through the loop, your form is gone.

Use alert(), unless you have dozens of fields.

Also, your loop is missing the last form element. That may be
what you want if you know that the last element is your submit
button. Otherwise, your loop should be:
for(i=0; i<InputForm.elements.length; i++)

Jul 23 '05 #2
voir typeOf

http://msdn.microsoft.com/library/de...tBelongsTo.asp

Matt a écrit:
I tried to display all html control types in the form. But it has run
time error
"object doesn't support this property or method" on
document.write(obj.type);

Even I do document.write('hello world'); it still has the same error.
function clearForm()
{ var i=0;
for (i=0; i<InputForm.elements.length-1; i++)
{ var obj = InputForm.elements[i];
document.write(obj.type); //runtime error: object doesn't support
this property or method
}
}

any ideas?? thanks!!


Jul 23 '05 #3
Lee
G Roydor said:

voir typeOf

http://msdn.microsoft.com/library/de...tBelongsTo.asp


No. He's trying to access the "type" field of form controls.

Jul 23 '05 #4

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

Similar topics

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...
2
by: SmittyBroham | last post by:
Hello, I have a function that loops through 2 select lists and records the values of any hi-lighted options a user would have selected. It then sets 2 corresponding "hidden" form elements to the...
0
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops...
6
by: Bill Patel | last post by:
I am getting Runtime error on line 50. Please Help. Thank You Bill 1 <%@ Page Language="VB" %> 2 <%@ import Namespace="System.Data" %> 3 <%@ import Namespace="System.Data.SqlClient"...
7
by: Martin Robins | last post by:
I am currently looking to be able to read information from Active Directory into a data warehouse using a C# solution. I have been able to access the active directory, and I have been able to return...
2
by: serviceman via AccessMonster.com | last post by:
Me Again, I just imported a working project from an SQL server based setup to an Access based setup, and now this code is giving me a 'runtime error 438 not defined' message : Private Sub...
4
by: Cylix | last post by:
Sample code of the problem: function inputOne() { alert('a'); } <input name="inputOne" id="inputOne" value="Warn" onclick="inputOne()"> The error is the object doesn't support this method.
3
by: Peachstone | last post by:
I'm using Windows XP and MS Access 2002. I am trying to write code in VB which is attached to a text control on a form called "Scripture1". I have another text control on the same form called...
21
vikas251074
by: vikas251074 | last post by:
I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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...
0
tracyyun
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...

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.