473,769 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.element s["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.javas cript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers.

Mar 3 '07 #1
2 1228
On Sat, 03 Mar 2007 01:00:01 +0100, FAQ server <ja********@dot internet.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.element s["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
10153
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 closes. The closing of the dropdown list can happen without changing the dropdown, hence the onchange event is not a sure way to determine that the dropdown list closed. Is this possible in Internet Explorer?
1
2810
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) it appears wierd: When I disable the selevt element in IE, it continues to appear as enabled (falsely) until I try changing it. When I click on it, updates itself as grey as to indicate that it is disabled.
2
3109
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 the closest I can get to it working doesn't work in FireFox. The first thing IE does wrong is that it only selects the last <option> even though the multiple attribute is set on the <select>. The other thing it does wrong is that it doesn't...
1
2496
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
1071
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - My element is named myselect , how do I access it? ----------------------------------------------------------------------- Form controls with any "illegal" characters can be accessed with ` formref.elements"] ` - The bracket characters, amongst others, are illegal in ID attributes and JavaScript identifiers, so you should try to avoid them as browsers...
0
10211
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, 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...
0
10045
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 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...
1
9994
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,...
0
9863
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 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...
0
8870
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, 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...
1
7408
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
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();...
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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 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...

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.