473,406 Members | 2,705 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,406 software developers and data experts.

FAQ Topic - My element is named myselect[] , how do I access it?

-----------------------------------------------------------------------
FAQ Topic - My element is named myselect[] , how do I
access it?
-----------------------------------------------------------------------

Form controls with any "illegal" characters can be accessed with
` formref.elements["myselect[]"] ` - The bracket characters,
amongst others, are illegal in ID attributes and JavaScript
identifiers, so you should try to avoid them as browsers may
handle them incorrectly.

http://msdn.microsoft.com/workshop/a...s/elements.asp

http://docs.sun.com/source/816-6408-10/form.htm

http://www.jibbering.com/faq/faq_not....html#FAQN4_25
===
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers.

Mar 3 '07 #1
2 1201
On Sat, 03 Mar 2007 01:00:01 +0100, FAQ server <ja********@dotinternet.be>
wrote:
-----------------------------------------------------------------------
FAQ Topic - My element is named myselect[] , how do I
access it?
-----------------------------------------------------------------------

Form controls with any "illegal" characters can be accessed with
` formref.elements["myselect[]"] ` - The bracket characters,
amongst others, are illegal in ID attributes and JavaScript
identifiers, so you should try to avoid them as browsers may
handle them incorrectly.

http://msdn.microsoft.com/workshop/a...s/elements.asp

http://docs.sun.com/source/816-6408-10/form.htm

http://www.jibbering.com/faq/faq_not....html#FAQN4_25

(...) The bracket characters,
amongst others, are illegal in ID attributes and JavaScript
identifiers, (...)
Correct according to:
'ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".").'
http://www.w3.org/TR/html401/types.html#type-cdata

Maybe that should change? Maybe the browsers should grow up?
http://www.whatwg.org/specs/web-form...ngFormControls
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Mar 3 '07 #2
OmegaJunior wrote:
On Sat, 03 Mar 2007 01:00:01 +0100, FAQ server wrote:
<snip>
>(...) The bracket characters,
amongst others, are illegal in ID attributes and JavaScript
identifiers, (...)

Correct according to:
Is that supposed to be an instruction?

In what way is the factual statement you cite above in need of
correction?
'ID and NAME tokens must ...
<snip>

In a javascript FAQ, if any rues that determine the legal character set
are to be cited it would make more sense to be citing the rules for a
javascript Identifier than an HTML ID attribute. In either case the
result would excessive for a "quick answer" in the FAQ.

Richard.

Mar 3 '07 #3

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

Similar topics

1
by: Rod Early | last post by:
I need to know when the select element's dropdown list is opened (as when the user clicks on the arrow or does ALT-downarrow from the keyboard). Similarly, I need to known when the dropdown list...
1
by: kebabkongen | last post by:
Hi, I'm working on a JavaScript that is enabling / disabling a select element according to whether a checkbox is selected or not. This works fine in Firefox, but in Internet Explorer (v 6.0.2900)...
2
by: rehevkor5 | last post by:
I have written Javascript which populates a form with <select> elements dynamically based on some other stuff going on in the page. The problem is that I can't get it to work properly in IE, and...
1
by: Axel Gallus | last post by:
I add some option items to a <selectbox by: ----- MySelect.length = null; // clears all options in select element for ( var i in Somename ) { MySelect.options = new Option(Somename,
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - My element is named myselect , how do I access it?...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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
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
agi2029
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.