Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 2nd, 2007, 11:15 PM
FAQ server
Guest
 
Posts: n/a
Default 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.


  #2  
Old March 3rd, 2007, 06:45 AM
OmegaJunior
Guest
 
Posts: n/a
Default Re: FAQ Topic - My element is named myselect[] , how do I access it?

On Sat, 03 Mar 2007 01:00:01 +0100, FAQ server <javascript@dotinternet.be>
wrote:
Quote:
-----------------------------------------------------------------------
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
>
>
Quote:
(...) 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/
  #3  
Old March 3rd, 2007, 10:45 AM
Richard Cornford
Guest
 
Posts: n/a
Default Re: FAQ Topic - My element is named myselect[] , how do I access it?

OmegaJunior wrote:
Quote:
On Sat, 03 Mar 2007 01:00:01 +0100, FAQ server wrote:
<snip>
Quote:
Quote:
>(...) 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?
Quote:
'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.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.