473,395 Members | 1,496 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,395 software developers and data experts.

field names in javascript

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
4 6229
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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: JDS | last post by:
Hi, all. I'd like to do the following, preferably *without* resorting to JavaScript: I have a long, dynamically-generated form questionnaire. Not all of the form fields are dynamically...
10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
6
by: tm | last post by:
I am trying to reference a table entry (qtyonhand) populated from a recordset. There is only one record displayed on this table. When i try to compare this displayed field to an input field...
3
by: Pavils Jurjans | last post by:
Hello, I have bumped upon this problem: I do some client-side form processing with JavaScript, and for this I loop over all the forms in the document. In order to identify them, I read their...
3
by: quickcur | last post by:
Hi, I am writing a javascript function. The idea is this very similar to the "color picker": 1. You have a html page where you have many text fields. Suppose each of them is a child's name....
5
by: effendi | last post by:
I am trying to write a simple routine multiplying one value of a field to another. i.e cost1 multiple by cost2.. But since I have many lines of these, I want to write a function by accessing the...
2
by: Sound | last post by:
Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Add a field without giving any name and save the...
13
by: Lee | last post by:
I have this function that doesn't work. I pass it the td element and an id, and it makes an input field inside the td. That part workds. What doesn't work is that I want to add an "onkeyup" on...
3
by: pollygw | last post by:
I have a page that dynamically adds rows to a table and the user can also delete any of the rows in no specific order. When the form is submitted I need to do some validation. I can't loop through...
10
by: Andy B | last post by:
If I have the following text in a dataset table column: "This agreement establishes that {BandName} will play on {EventDate} between {StartTime} and {EndTime}..." How would I then take the field...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
0
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...

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.