473,507 Members | 6,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

issues with form elements

if I have
if (document.form[0].element[0].type == "select")
and I have a form with at liest 1 element on the page this should work
right?

I keep getting a "document.form.0 is null or not an object" message any
idea why?

john
Jul 20 '05 #1
2 3752
john <wenjoh26@em*********@pct.edu> wrote in
news:Xn*********************************@216.65.98 .9:
if I have
if (document.form[0].element[0].type == "select")
and I have a form with at liest 1 element on the page this should work
right?

I keep getting a "document.form.0 is null or not an object" message any
idea why?


document.forms[0].elements[0].

??
Jul 20 '05 #2
"Evertjan." <no**@none.nl> wrote in message
news:Xn********************@194.109.133.29...
john <wenjoh26@em*********@pct.edu> wrote in
news:Xn*********************************@216.65.9 8.9:
if I have
if (document.form[0].element[0].type == "select")
and I have a form with at liest 1 element on the page
this should work right?

I keep getting a "document.form.0 is null or not an object"
message any idea why?


document.forms[0].elements[0].


However, from the W3C HTML DOM specs:-

Interface HTMLSelectElement
type of type DOMString, readonly.
The type of this form control. This is the string
"select-multiple" when the multiple attribute is true
and the string "select-one" when false.

-so comparison with the string "select" should not be expected to work.
But, IceBrowser 5 is an example of at least one browser that erroneously
assigns the string "select" to the - type - property of a SELECT element
so it might be best to check to see if the - type - property contains
the substring "select" (and then maybe the - multiple - property if that
is important).

Richard.
Jul 20 '05 #3

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

Similar topics

3
17772
by: Philip V Pham | last post by:
These questions apply to std vector, map, and cout: I am uncertain of the thread safety for reading/writing for std templates. I know if all threads are reading concurrently, it is thread...
1
1606
by: Howard Jess | last post by:
Apparently, form elements of type <input type="image" src="...> are not included in the form's elements collection. I don't understand why not; according to DOM2, all form control elements...
6
2716
by: Chris Styles | last post by:
Dear All, I've been using some code to verify form data quite happily, but i've recently changed the way my form is structured, and I can't get it to work now. Originally : The form is...
19
2432
by: MMMMM | last post by:
Hmmm, my array seems to be emptying itself for no reason. I just want to grab every form element posted to the page into an appropriately sized array... What is going on here? dim arrShort()...
1
9622
by: Peter Nofelt | last post by:
Hey All, I'm running into this issue with parsing through an xml document by tag name. Below is an example xml document: File Name: things.xml <things> <people> <name>Peter</name>
10
3060
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
0
1006
by: Neal | last post by:
Hi All, Help please Cross browser and W3C issues: Having major hassles trying to get my site working and looking decent in FFox (great in IE), MOzzie support said to try the W3C Validator so...
8
5566
by: dixzyt | last post by:
Hi I wonder if anyone would be so kind as to help me with this issue that's driving me nuts! The webpage below displays correctly on IE & Opera but NOT on Firefox 2.0.
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
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
7372
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...
1
7030
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
7482
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...
0
3191
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
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...

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.