By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,261 Members | 1,674 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,261 IT Pros & Developers. It's quick & easy.

field names in javascript

P: n/a
dan
I need to use a different type of name for a field in a form. does
anyone know how I can access this with this kind of name?

<input type="text" name ="id[txt_3]" size="6" maxlength="6" value="">

now how can I access this name in javascript?
//this doesn't work??

document.form_name.id[txt_3].value
document.form_name.?????????.value
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ry*****@yahoo.com (dan) writes:
I need to use a different type of name for a field in a form. does
anyone know how I can access this with this kind of name?

<input type="text" name ="id[txt_3]" size="6" maxlength="6" value="">


<URL:http://jibbering.com/faq/#FAQ4_39>
might help you.

(then read it all :)
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
Lasse Reichstein Nielsen wrote on 20 Nov 2003:
<URL:http://jibbering.com/faq/#FAQ4_39>
might help you.


It will almost. It doesn't say in the FAQ that square brackets are
illegal characters in control names. The original poster should see
my reply in his earlier thread (also started today).

Mike

--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #3

P: n/a
Michael Winter <M.******@blueyonder.co.uk.invalid> writes:
It doesn't say in the FAQ that square brackets are illegal
characters in control names. The original poster should see my reply
in his earlier thread (also started today).


It does, I just omitted the reference because they are not illegal
(see my reply to your reply :)

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4

P: n/a
"Michael Winter" <M.******@blueyonder.co.uk.invalid> wrote in message
news:Xn******************************@193.38.113.4 6...
Lasse Reichstein Nielsen wrote on 20 Nov 2003:
<URL:http://jibbering.com/faq/#FAQ4_39>
might help you.


It will almost. It doesn't say in the FAQ that square
brackets are illegal characters in control names. The
original poster should see my reply in his earlier thread
(also started today).


It turned out that square brackets are legal characters in the strings
provided as values to name attributes. The restrictions you mentioned in
that post do apply to ID attributes but not name (which are just CDATA).

Prior to the discussion of legal characters in name attribute strings I
also believed that those additional restrictions applied to name
attributes as well as IDs. But cross referencing the fragment
identifiers on the links used in (HTML versions of) the DTDs with the
fragment identifiers used within the UL/LI element/s used in the "SGML
basic types" sections of "types.html" in HTML specifications at the W3C
made it clear that NAME and ID "tokens" are distinct from CDATA.

Richard.
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.