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

Query on arrays of controls

P: n/a

It is well-documented that if on a page there are several radio-
buttons with the same name these are addressed as an array (and act
collectively).

Someone (LRN?) recently wrote about another case where name-match
implies array addressing.

It therefore occurred to me to try the following crude Web page :

<head></head><body>

<form name=F1>
<input type=text name=A size=3 value=00>
<input type=text name=A size=3 value=11>
<input type=text name=A size=3 value=22>
<input type=button name=B onClick=X() value=" ?? ">
</form>

<script>
J=0

function X() {
F1.B.value = " " + F1.A[J++%3].value + " "
}

</script>
</body>

On it, in my MSIE4, pressing the ?? button repeatedly cycles its
legend through 00 11 22 00 11 22 00 ... which demonstrates that such
a set of name-matched controls can be accessed as an array there.

Is that legitimate and generally available? I do not recall reading
it.

In particular, where I have a table similar in principle to

2001 2002 2003 2004 2005
St P Sat Sun Mon Wed Thu
St G Mon Tue Wed Fri Sat
St A Fri Sat Sun Tue Wed

and wish to auto-change the columns to be Year-2..Year+2 for any
(current) Year, can I use for the St P row five instances of
<input type=text name=StP size=5 readonly> and compute in turn
elements [0]..[4] of this array (likewise for other rows), and have
it working successfully for all reasonable javascript-enabled
browsers?

Could I use <div>..</div> with DynWrite thus, instead of <input
....>?

I postpone the possibility of having a dynamic column-count such
that there is at least one instance of each of the days of the week
in both the row for Feb 28 and that for Mar 1.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #1
Share this Question
Share on Google+
17 Replies


P: n/a
Dr John Stockton wrote on 27 Nov 2003:

<snip>
<input type=button name=B onClick=X() value=" ?? ">
Omission of the quotes around the onclick attribute value may have
been intentional, but I would like to point out that the only non-
alphanumeric characters that may appear in an unquoted attribute
value are hyphens, periods, underscores and colons.

<snip>
On it, in my MSIE4, pressing the ?? button repeatedly cycles its
legend through 00 11 22 00 11 22 00 ... which demonstrates that
such a set of name-matched controls can be accessed as an array
there.

Is that legitimate and generally available? I do not recall
reading it.
Netscape's JavaScript reference (v1.3) states in the introduction for
the Radio object that a group of radio buttons under the same name
may be indexed with subscripts. In addition, the DOM method,
getElementsByName, will return "the (possibly empty) collection of
elements whose name value is given" in the argument to the method.
In particular, where I have a table similar in principle to

2001 2002 2003 2004 2005
St P Sat Sun Mon Wed Thu
St G Mon Tue Wed Fri Sat
St A Fri Sat Sun Tue Wed

and wish to auto-change the columns to be Year-2..Year+2 for any
(current) Year, can I use for the St P row five instances of
<input type=text name=StP size=5 readonly> and compute in turn
elements [0]..[4] of this array (likewise for other rows), and
have it working successfully for all reasonable
javascript-enabled browsers?
Only INPUTs of type radio and checkbox can share control names. A
solution would be to use an array that contained the names of each
text box, index that, and use the value with the elements property of
a Form object or, if they are id values, as the argument to the
getElementById method.
Could I use <div>..</div> with DynWrite thus, instead of <input
...>?


If you are referring to dynamically altering an already loaded page,
I wouldn't know. If not, could you explain what you mean here?

Mike

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

P: n/a
Dr John Stockton <sp**@merlyn.demon.co.uk> writes:
It is well-documented that if on a page there are several radio-
buttons with the same name these are addressed as an array (and act
collectively). Someone (LRN?) recently wrote about another case where name-match
implies array addressing.
Probably. It works that way for all form controls. Try:

<form id="foo">
<input type="text" name="x" value="42">
<input type="radio" name="x" value="37">
<input type="checkbox" name="x" value="87">
<select name="x"><option value="13" selected="selected">X</option></select>
</form>
<script type="text/javascript">
var xs = document.forms['foo'].elements['x'];
alert([xs.length,xs[0].value,xs[1].value,xs[2].value,xs[3].value]);
</script>

It alerts
4,42,47,87,13
in IE6, Opera 7, and Mozilla (and with some rewriting also in Netsape 4).

J=0

function X() {
F1.B.value = " " + F1.A[J++%3].value + " "
} On it, in my MSIE4, pressing the ?? button repeatedly cycles its
legend through 00 11 22 00 11 22 00 ... which demonstrates that such
a set of name-matched controls can be accessed as an array there.
It's not an array. If you check with "... instanseof Array", it gives
false. In Opera, it's an Object. In Mozilla, it's a NodeList. The
important thing is that it doesn't have a dynamic length or the methods
of Array.prototype.
Is that legitimate and generally available?
Apart from writing
F.B.value
instead of
document.forms.F.elements.B.value
then yes. (It wouldn't work in Mozilla using F as a global variable)
I do not recall reading it.
I can't find it in the DOM specification.
The HTMLFormDocument's "elements" property is a HTMLCollection.
Its "namedItem" method is only allowed to return a single Node.

It is probably a result of the DOM specification being written
to be compatible with typed languages, so the "namedItem" method
can't return a Node in some cases and a NodeList in others (NodeList
is what is returned by, e.g., getElementsByTagName)

So, you'll have to look at the browser specific DOMs to find anything.

in Microsoft's documentation, you find:
---
If this parameter is a string and there is more than one element
with the name or id property equal to the string, the method returns
a collection of matching elements.
---
There is problably something similar in a Netscape documentation.
In particular, where I have a table similar in principle to 2001 2002 2003 2004 2005
St P Sat Sun Mon Wed Thu
St G Mon Tue Wed Fri Sat
St A Fri Sat Sun Tue Wed

and wish to auto-change the columns to be Year-2..Year+2 for any
(current) Year, can I use for the St P row five instances of
<input type=text name=StP size=5 readonly> and compute in turn
elements [0]..[4] of this array (likewise for other rows), and have
it working successfully for all reasonable javascript-enabled
browsers?
It should work. But if you have a table with a known width/height, you
can just name the elements based on the coordinates, e.g.
name="St(2,3)"
Could I use <div>..</div> with DynWrite thus, instead of <input
...>?


Not generally, no. There is no "name" attribute on a div, and the
"id" attribute must be unique. In IE, you can have several elements
with the same id, and document.all/document.getElementById will
return a collection. That is not portable.

/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 #3

P: n/a
Michael Winter <M.******@blueyonder.co.uk.invalid> writes:
Only INPUTs of type radio and checkbox can share control names.


Reference? I see no such restriction in the HTML 4.01 specification.

It does *hint* it:
---
Several checkboxes in a form may share the same control name.
---
and
---
Radio buttons are like checkboxes except that when several share the
same control name, they are mutually exclusive
---
No other control has its name mentioned.
perhaps it is what they mean by
---
The scope of the name attribute for a control within a FORM element
is the FORM element.
---

/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
Lasse Reichstein Nielsen wrote on 27 Nov 2003:
Michael Winter <M.******@blueyonder.co.uk.invalid> writes:
Only INPUTs of type radio and checkbox can share control names.


Reference? I see no such restriction in the HTML 4.01
specification.

It does *hint* it:
---
Several checkboxes in a form may share the same control name.
---
and
---
Radio buttons are like checkboxes except that when several
share the same control name, they are mutually exclusive
---
No other control has its name mentioned.
perhaps it is what they mean by
---
The scope of the name attribute for a control within a FORM
element is the FORM element.
---


Two controls in different forms can use the same name, but what Dr
Stockton wanted to do was use several text boxes with the same name
in the same form, which you cannot do. My statement was meant in the
context of his query, though I suppose I should have written:

Only INPUTs of type radio and checkbox can share control names within
the same form.

I knew the distinction, but I didn't feel it merited mentioning. I
was wrong.

Mike

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

P: n/a
Michael Winter <M.******@blueyonder.co.uk.invalid> writes:
Two controls in different forms can use the same name, but what Dr
Stockton wanted to do was use several text boxes with the same name
in the same form, which you cannot do.
That is what I was asking for a reference for. I can't find that
restriction in the HTML specification.
My statement was meant in the context of his query, though I suppose
I should have written:

Only INPUTs of type radio and checkbox can share control names within
the same form.


That's how I read it. There is no explicit requirement in HTML that
control names must be distinct, and no browser that I have available
have a problem with several controls with the same name. The resulting
URL is "...?x=XXX&x=YYY&x=ZZZ".

/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 #6

P: n/a
Lasse Reichstein Nielsen wrote on 27 Nov 2003:
Reference? I see no such restriction in the HTML 4.01
specification.

It does *hint* it: No other control has its name mentioned.


In my previous response, I didn't think properly about the above
statements. You are correct - there is no restriction stating that
control names must be unique within a form. In fact, it appears that
with form submission, data would be sent like so:

<FORM action="..." method="get">
<INPUT name="address" value="My house number">
<INPUT name="address" value="My street">
<INPUT name="address" value="My city">
</FORM>

....?address=My+house+number&address=My+street&add ress=My+city

That is, all data, in the order it appears in the document.

I have a question though. I know very little of the DOM, so I was
wondering if someone could tell me how you would know what form
elements came from which form if you retrieved them using
HTMLDocument.getElementsByName(). After obtaining the collection
returned, would you use Node.parentNode to get a HTMLFormElement
object, then HTMLFormElement.name to get the name? So, for the first
matching name (we'll assume it will be in a form), would it be
something like this?

function getFormContaining( elementName ) {
var matches = document.getElementsByName( elementName );

return matches[ 0 ].parentNode.name;
}

Mike
I will learn about the DOM someday...

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

P: n/a
Lasse Reichstein Nielsen wrote on 27 Nov 2003:
Michael Winter <M.******@blueyonder.co.uk.invalid> writes:
Two controls in different forms can use the same name, but what
Dr Stockton wanted to do was use several text boxes with the
same name in the same form, which you cannot do.


That is what I was asking for a reference for. I can't find that
restriction in the HTML specification.


Please ignore that - read my other post.

Mike

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

P: n/a
Michael Winter <M.******@blueyonder.co.uk.invalid> writes:
...?address=My+house+number&address=My+street&addr ess=My+city

That is, all data, in the order it appears in the document.
I wouldn't depend on the order. Other browsers could change that
without warning
I have a question though. I know very little of the DOM, so I was
wondering if someone could tell me how you would know what form
elements came from which form if you retrieved them using
HTMLDocument.getElementsByName().
All form controls have a property, "form", that is a reference to
the form they are within.
After obtaining the collection
returned, would you use Node.parentNode to get a HTMLFormElement
No. The form doesn't need to be the immediate parent node of the
form control (and usually isn't).
return matches[ 0 ].parentNode.name;


return matches[0].form.name;

/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 #9

P: n/a
Lasse Reichstein Nielsen wrote on 27 Nov 2003:
Michael Winter <M.******@blueyonder.co.uk.invalid> writes:
...?address=My+house+number&address=My+street&addr ess=My+city

That is, all data, in the order it appears in the document.


I wouldn't depend on the order. Other browsers could change that
without warning


You should be able to. That is defined in the specification:

For application/x-www-form-urlencoded (which includes anything
submitted with the GET method), "The control names/values are listed
in the order they appear in the document."

For multipart/form-data, "The parts are sent to the processing agent
in the same order the corresponding controls appear in the document
stream."

I don't know if scripting languages have that order imposed, though
(I haven't looked, nor do I quite know where to look).

<snipped reply to DOM question>

OK, thank you.

Mike

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

P: n/a
Dr John Stockton wrote:
It is well-documented that if on a page there are several radio-
buttons with the same name these are addressed as an array (and act
collectively).

Someone (LRN?) recently wrote about another case where name-match
implies array addressing.
Form elements of the same name create a collection which is an object
having numeric properties (and a length property). It is not an array
(object).
<input type=button name=B onClick=X() value=" ?? ">
You must single/double-quote the value of the onclick attribute because
of the `(' and `)'.
<script>
The `type' attribute is mandatory.
J=0
It is good style to end JavaScript statements with `;'.
function X() {
It is also good style to name functions other than
constructors with a leading lowercase character.
F1.B.value = " " + F1.A[J++%3].value + " "
You should not use the (non-breaking) space character if you need space
between content. Instead, use CSS to define how content should be
formatted.
}

</script>
</body>

On it, in my MSIE4, pressing the ?? button repeatedly cycles its
legend through 00 11 22 00 11 22 00 ... which demonstrates that such
a set of name-matched controls can be accessed as an array there.
It demonstrates that you can access those elements by the index operator
`[...]', nothing else.
Is that legitimate and generally available?
It is not but only because of F1.B which should read
document.forms["F1"].elements["B"].
I do not recall reading it.
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-75708506
In particular, where I have a table similar in principle to

2001 2002 2003 2004 2005
St P Sat Sun Mon Wed Thu
St G Mon Tue Wed Fri Sat
St A Fri Sat Sun Tue Wed

and wish to auto-change the columns to be Year-2..Year+2 for any
(current) Year, can I use for the St P row five instances of
<input type=text name=StP size=5 readonly> and compute in turn
elements [0]..[4] of this array (likewise for other rows), and have
it working successfully for all reasonable javascript-enabled
browsers?
Again, it is no array. But yes, you can. The collections, although
first standardized in W3C-DOM Level 1, is part of the so-called DOM
Level 0, which originates from the 3.0 versions of Netscape and
Internet Explorer.
Could I use <div>..</div> with DynWrite thus, instead of <input
....>?


That would be a misuse of the DIV element which should mark a division
of a document (containing text, supposedly paragraphs). You have a
table-like layout and should therefore use table elements, primarily
`table', `tr' and `td'.
PointedEars
Jul 20 '05 #11

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.de> writes:
Form elements of the same name create a collection which is an object
having numeric properties (and a length property). It is not an array
(object).
The DOM specification doesn't say so. It makes no provision for more
than one control having the same name.
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-75708506


Actually, the result is not a collection.

In Opera 7, it is an ElementsArray, in Mozilla its a NodeList (the
same type as is returned by getElementsByTagName). They implement the
interface of an HTMLCollection, though (the method "namedItem", which
isn't part of a NodeList, and seems to be the only difference between
a NodeList and an HTMLCollection).

In Mozilla,
document.forms.foo.elements.x instanceof HTMLCollection
gives false, while
document.forms.foo.elements.x instanceof NodeList
gives true.

In IE I don't know what it is, it might be a collection. But it is a
very awkward object, because if you iterate through its properties
with for(...in...), the name occourse once for each control with that
name. That is, the same property name occours more than once during
the iteration.

/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 #12

P: n/a
Dr John Stockton <sp**@merlyn.demon.co.uk> writes:
JRS: In article <y8**********@hotpop.com>, seen in
news:comp.lang.javascript, Lasse Reichstein Nielsen <lr*@hotpop.com>
posted at Thu, 27 Nov 2003 21:02:31 :-
name="St(2,3)"


To check whether I understand : while that looks like a quoted C array
(?) or a function call, it is actually a mere string of three parts -
Alpha since names should start that way, an up/down part, and a left-
right part.


Correct. Since names can contain anything, I decided to use a standard
coordiante notation. In practice, "St_2_3" would probably be better,
and it contains the same information.
In addressing, the names would be computed, rather than indexing a
single name.
Precisely.
If I use separators, they will be ones commonly used in names, probably
underscores; or even as x12y25 (I can assume 2 digits always suffice.
Good choice :)
But I could, I think, DynWrite[1] the whole Table into a <div> after the
page is loaded ... which is not needed, so I can document.write it
during page loading ... which, by parameterising the data, may well
reduce the page size.
Yes. If the page critically depends on Javascript anyway, creating the
content with Javascript isn't a problem. If the page can be used
without Javascript, then making it dependent is inferior.
The appearance that way would be a lot better than what using
controls would give; would, in fact, be unchanged.


Yes, there would be no difference between that table and any other
table, except what you choose.

/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 #13

P: n/a
Dr John Stockton wrote:
Thomas 'PointedEars' Lahn [...]:
Dr John Stockton wrote:
which demonstrates that such
a set of name-matched controls can be accessed as an array there.
It demonstrates that you can access those elements by the index operator
`[...]', nothing else.


That is indistinguishable.


Disagreed.
My words do not imply having all the properties of an array.
AIUI, when you access something as an array, it is an Array object,
meaning its constructor function is Array(...). In contrast, when
you access something *like* an array, you access something on which
you can (also) use the index operator to access an element of it.
Is that legitimate and generally available?


It is not but only because of F1.B which should read
document.forms["F1"].elements["B"].


Valid, but not relevant to the question.


It is of course relevant to the question. You asked for general
availability. Nowhere is specified that you can access
document.forms["F1"].elements["B"] with document.F1.B as well.
Could I use <div>..</div> with DynWrite thus, instead of <input
....>?


That would be a misuse of the DIV element which should mark a division
of a document (containing text, supposedly paragraphs). You have a
table-like layout and should therefore use table elements, primarily
`table', `tr' and `td'.


The only helpful unsolicited observation; but not a well-considered one.
You have not stated whether <div> *could* be used,


If I write that it is a misuse it is obvious that it *can* be used but
*should* *not*.
nor have you stated whether DynWrite should generally work into a
named table element.


I do not know Dynwrite, but suppose it to be a method using
document.write(...).

BTW: What do you think this is, a support forum or stuff like that?
If you don't like my answers, don't read them. If you don't like my
advice, don't follow it. But at least don't complain about it!
PointedEars
Jul 20 '05 #14

P: n/a
Dr John Stockton wrote on 28 Nov 2003:
JRS: In article
<Xn*******************************@193.38.113.46 >, seen in
news:comp.lang.javascript, Michael Winter
<M.******@blueyonder.co.uk. invalid> posted at Thu, 27 Nov 2003
20:18:44 :-

Two controls in different forms can use the same name, but what
Dr Stockton wanted to do was use several text boxes with the
same name in the same form, which you cannot do.


Not so; I have done it.

It may be that one should not do it; or that there is no
authority for doing it; or that current authority explicitly
disallows it; or that it does not always work; but it can be
done.


In another post (my reply to Mr Nielsen's post of Thu 27 @ 8:29:27),
I suggested that one should ignore what you quoted. I basically
misread the specification and made dangerous assumptions.

Apologies,
Mike

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

P: n/a
JRS: In article <r7**********@hotpop.com>, seen in
news:comp.lang.javascript, Lasse Reichstein Nielsen <lr*@hotpop.com>
posted at Fri, 28 Nov 2003 23:02:00 :-
But I could, I think, DynWrite[1] the whole Table into a <div> after the
page is loaded ... which is not needed, so I can document.write it
during page loading ... which, by parameterising the data, may well
reduce the page size.


Yes. If the page critically depends on Javascript anyway, creating the
content with Javascript isn't a problem. If the page can be used
without Javascript, then making it dependent is inferior.


Without the tabular content, the page is of little use. But I'm
beginning to feel that without Javascript to do it automatically, the
page <URL:http://www.merlyn.demon.co.uk/holidays.htm> might not get
updated.

H'mmm - the data could be in an include file, which would open the door
to production of, say, a Danish version of the Table ...

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Jul 20 '05 #16

P: n/a
JRS: In article <3F**************@PointedEars.de>, seen in
news:comp.lang.javascript, Thomas 'PointedEars' Lahn
<Po*********@web.de> posted at Sat, 29 Nov 2003 02:30:49 :-

I do not know Dynwrite, but suppose it to be a method using
document.write(...).


It is not.

To contribute to a newsgroup without bothering to read the regularly-
posted FAQ is either stupid or arrogant or unhelpful (or != xor).

With your self-acknowledged vast knowledge of the language, you should
have known that it is not a function specified by ECMA, Microsoft, etc.;
and you should have realised that I would not have referred to it in
that manner if I had not thought that regulars here should know about
it.

You may, of course, feel that you know so much that no FAQ can possibly
teach you anything.

But a knowledge of the contents of the FAQ would enable you to see that
some questions are best answered by citing it, rather than by repeating
well-known material. Citing the FAQ may pre-empt other questions.

And it is always possible that you might be able to suggest improvements
to the FAQ.

As regards DynWrite : it may be less worthwhile if only the latest
browsers are to be supported; nevertheless, if a script can use it
several times, IMHO using a version of DynWrite is still worthwhile
since it expresses the action, the source, and the destination without
encumbering the statement with mechanism.

Insufficient use of subroutines is one of the three commonest faults one
sees in code posted here, possibly omitting faults-of-detail.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #17

P: n/a
JRS: In article <fx**************@merlyn.demon.co.uk>, seen in
news:comp.lang.javascript, Dr John Stockton <sp**@merlyn.demon.co.uk>
posted at Sat, 29 Nov 2003 11:33:28 :-
Without the tabular content, the page is of little use. But I'm
beginning to feel that without Javascript to do it automatically, the
page <URL:http://www.merlyn.demon.co.uk/holidays.htm> might not get
updated.

H'mmm - the data could be in an include file, which would open the door
to production of, say, a Danish version of the Table ...


More or less done, AFAICS, except that there is not yet provision for
supplying the Danish words for "Annual Holidays", "Holiday", "Month,
"Day", which should be easy enough.

There's currently no Include file; the code for a big Object defining
the holidays and selecting their rules needs to be pasted into a
TextArea. Data and rule-types for the British Isles and for North
America are built in, however.

The draft is at <URL:http://www.merlyn.demon.co.uk/hols.htm>.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.