FAQ Topic - How do I get the value of a form control?

F

FAQ server

-----------------------------------------------------------------------
FAQ Topic - How do I get the value of a form control?
-----------------------------------------------------------------------

In HTML documents, named forms may be referred to as named
properties of the « document.forms » collection, and named form
controls may be referred to as named properties of the form's
elements collection:

var frm = document.forms["formname"];
var contrl = frm.elements["elementname"];

The (string) value property of such controls can be read
directly from the element:-

var value = contrl.value;
var value = (+contrl.value); //string to number: see 4.21

Some exceptions would be:

First Exception: Where the control is a SELECT element, and
support for older browsers, such as NN4, is required:

var value = contrl.options[contrl.selectedIndex].value;

Second Exception: Where several controls share the same name,
such as radio buttons. These are made available as collections
and require additional handling. For more information, see:-

http://www.jibbering.com/faq/faq_notes/form_access.html

Third Exception: File Inputs where most current browsers do not
allow the reading of type="file" input elements in a way that is useful.


===
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://www.jibbering.com/faq/.
The FAQ workers are a group of volunteers.
 
D

Dr J R Stockton

In comp.lang.javascript message
FAQ Topic - How do I get the value of a form control?
In HTML documents, named forms may be referred to as named
properties of the ‹ document.forms › collection, and named form
controls may be referred to as named properties of the form's
elements collection:

var frm = document.forms["formname"];
var contrl = frm.elements["elementname"];

Status of document.formname & frm.elementname ?
The (string) value property of such controls can be read
directly from the element:-

var value = contrl.value;
var value = (+contrl.value); //string to number: see 4.21

Parentheses superfluous. // String to Number: see 4.21 (elegance)


It would be useful for the FAQ to have a section or subsection on the
Notes. This would contain the paragraph of Sec.1 on Notes, and a List
of the Note Subjects, as Links. It could contain, for each Note, the
Maintainer (if active) and should have a date or version number.


In the HTML version of the FAQ, it would be better for a Link to the
Notes to be indicated as
Notes: <a href="url">Actual Subject Line</a>
but the effect on plain-text versions needs consideration.

Links to non-Notes could be similar, but with "Notes:" replaced by an
indication of the site; generally the prime field of the site part of
the URL (e.g. ajaxtoolbox) or the author's name.


Recently you wrote "9.4 contains" or similar. "9.4 will contain" would
have been better, to avoid tempting hopeful readers to refetch and get
9.3 again.


The FAQ CSS file should be re-named. Just "faq.css" is too general,
given that IE6 at least saves it when the page is saved. Call it
"clj-faq.css"! Indeed, the FAQ itself is not well named as "index.html"
and its name should contain "clj" too - "clj-faq.htm".


Where there are parts of the FAQ that are manifestly wrong but serve as
place-holders, they should be marked, maybe italics or greyed. Example
: S.1 : "The FAQ will currently be posted in two parts, one part (the
Quick Answers) on Mondays and Fridays, with the remainder posted on
Wednesdays."


ISTR that you have views on the use of semicolons. It is generally
accepted that in CSS every "item" (such as "COLOR: #000000;") should
have a final semicolon, even if it is the last of its set. FAQ.CSS does
not comply.

It's a good idea to read the newsgroup and its FAQ. See below.
 
R

Randy Webb

Dr J R Stockton said the following on 12/21/2006 10:36 AM:
In comp.lang.javascript message
FAQ Topic - How do I get the value of a form control?
In HTML documents, named forms may be referred to as named
properties of the ‹ document.forms › collection, and named form
controls may be referred to as named properties of the form's
elements collection:

var frm = document.forms["formname"];
var contrl = frm.elements["elementname"];

Status of document.formname & frm.elementname ?

Your question is vague when you ask about the status. Are you asking
what the status of the document.formname convention is? The FAQ code
uses bracket notation because it has fewer side effects than dot
Parentheses superfluous. // String to Number: see 4.21 (elegance)

They are not "superfluous", they are there for a reason (which I have
explained at least twice) and won't explain again.
It would be useful for the FAQ to have a section or subsection on the
Notes. This would contain the paragraph of Sec.1 on Notes, and a List
of the Note Subjects, as Links. It could contain, for each Note, the
Maintainer (if active) and should have a date or version number.

The section on the notes would be counter-productive as the next major
revision (hopefully 10.0 or at least 10.x) will have any relevant Notes
sections linked to in the corresponding entry in the FAQ.

Maintainer of the Notes section I have already explained is limited - to
the best of my knowledge - to three people. Irregardless of who wrote an
entry in the Notes, unless they are one of those three people it is
irrelevant - and wasted time - trying to document who wrote it and I
won't waste my time trying to do it.

Date and Version Number? You must be kidding. I am not giving the Notes
Pages a version number. Want the date it was modified? Look at
document.lastModified for the document.
In the HTML version of the FAQ, it would be better for a Link to the
Notes to be indicated as
Notes: <a href="url">Actual Subject Line</a>
but the effect on plain-text versions needs consideration.

That was my intentions with the links. With regards to the plain-text
versions it is something I am still working on. As it is now, it is not
that simple to give a link text as the way the XML file is parsed does
not lend itself to doing that.

The FAQ has always been generated from an XML file along with the text
versions. With 10.0, I am going to go backwards where I get the HTML I
want and then write the XML format to produce it. Basically, starting
over with it all. With doing that, it is a lot simpler to give links a
separate text from the URL of the link.
Links to non-Notes could be similar, but with "Notes:" replaced by an
indication of the site; generally the prime field of the site part of
the URL (e.g. ajaxtoolbox) or the author's name.

I don't think I will be inclined to review every link in the FAQ to come
up with the text for the label for the link. If you want to do it, I
will be glad to incorporate it (within reasonable limits).
Recently you wrote "9.4 contains" or similar. "9.4 will contain" would
have been better, to avoid tempting hopeful readers to refetch and get
9.3 again.

I assume by "you" that you are referring to me but you are not replying
to me.

As for me referring to 9.4, a search of the archives for "Randy Webb
9.4" turns up one post and this is the entire body of it:

<quote>
Major change: MSDN URL's that were redirect pages were changed to the
destination page.
</quote>

So I am not sure where you got "9.4 contains". Somewhere in the two
threads about 9.3 I probably did say "9.3 contains" though.
The FAQ CSS file should be re-named.

I have an email from Jim where I asked him about moving files out of the
faq folder into the faq\old folder to try to clean up the folder some
(it has a lot of the old faq documents there). His response, which I
totally agree with, was "I don't like ever changing URI's which exist"
and faq.css is part of that URL so until 10.0 comes out it will stay as
faq.css but I don't see where it makes any difference what the name of
the external file is and for the sake of knowing - on the server - what
it goes to, it will probably stay named faq.css.
Just "faq.css" is too general, given that IE6 at least saves it when the
page is saved.

If you want to rename it for your local copy then feel free to. You have
said in the past that you have named the HTML file differently. Just
edit the code to match your CSS file name.
Call it "clj-faq.css"! Indeed, the FAQ itself is not well named as "index.html"
and its name should contain "clj" too - "clj-faq.htm".

See above about changing file names.
Where there are parts of the FAQ that are manifestly wrong but serve as
place-holders, they should be marked, maybe italics or greyed. Example
: S.1 : "The FAQ will currently be posted in two parts, one part (the
Quick Answers) on Mondays and Fridays, with the remainder posted on
Wednesdays."

I am not sure why the Monday/Wednesday/Friday postings are not made,
that would be up to Bart to answer. It is just as easy for me to update
the mon/wed/fri text files when I change the index file so that the text
files stay updated. That is the major reason I am even going to write a
..wsf and .xml file is so the text postings can continue.
ISTR that you have views on the use of semicolons.

Yes, I have views about semicolons :)
It is generally accepted that in CSS every "item" (such as "COLOR: #000000;")
should have a final semicolon, even if it is the last of its set. FAQ.CSS does
not comply.

Where? I just looked at http://jibbering.com/faq/faq.css and the *only*
problem I see with it is a comment delimiter problem. I am not going to
re-upload a new file to fix that problem until you have a chance to tell
me where in that file you find an "item" that doesn't have an ending
semicolon as I don't fine one.

The modified version I have ready to upload has the definitions before
the second */ removed. I think the error there was in Rob commenting
them out and missing the opening comment delimiter.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>,
Dr J R Stockton said the following on 12/21/2006 10:36 AM:
In comp.lang.javascript message
FAQ Topic - How do I get the value of a form control?
In HTML documents, named forms may be referred to as named
properties of the ‹ document.forms › collection, and named form
controls may be referred to as named properties of the form's
elements collection:

var frm = document.forms["formname"];
var contrl = frm.elements["elementname"];
Status of document.formname & frm.elementname ?

Your question is vague when you ask about the status. Are you asking
what the status of the document.formname convention is? The FAQ code
uses bracket notation because it has fewer side effects than dot
notation. <form name="my-form"> doesn't work with dot notation. If that
isn't what you are asking, then I am not sure what you are asking.

I'm not asking anything. I'm suggesting that there should be a mention
of that convention and its applicability. Obviously it can only be
applicable where elementname's "spelling" is compatible; but it's not
obvious how widely it is usable. Those who use MSIE themselves may -
should - wish to know whether it is usable in near-enough all current
systems.

They are not "superfluous", they are there for a reason (which I have
explained at least twice) and won't explain again.

Their presence implies that they are necessary, which they are not. A
faulty explanation is not improved by mere repetition.

The section on the notes would be counter-productive as the next major
revision (hopefully 10.0 or at least 10.x) will have any relevant Notes
sections linked to in the corresponding entry in the FAQ.

Maintainer of the Notes section I have already explained is limited -
to the best of my knowledge - to three people. Irregardless of who
wrote an entry in the Notes, unless they are one of those three people
it is irrelevant - and wasted time - trying to document who wrote it
and I won't waste my time trying to do it.

Disregard who *can* currently maintain the Notes - anyone can, if they
can persuade Jim to let them. The question is one of whether anyone -
and if so, who - is actually maintaining each Note.
Date and Version Number? You must be kidding. I am not giving the Notes
Pages a version number. Want the date it was modified? Look at
document.lastModified for the document.

And how do you expect a FAQ user to read that string? Anyway, d.lM is
the date of last upload; a maintainer should be able to silently correct
such as spelling mistakes without publicly showing that it is a new
"version".

I don't think I will be inclined to review every link in the FAQ to
come up with the text for the label for the link. If you want to do it,
I will be glad to incorporate it (within reasonable limits).

Using a few simple Batch tools, I see that there are only about 49
distinct sites cited. Many of those you will instantly recognise - W3,
merlyn, jibbering, oreilly, sun, wipo, mozilla, davidflanagan,
wikipedia, microsoft, galasoft, google, ietf, apple, ecma for example.

I assume by "you" that you are referring to me but you are not replying
to me.

Default "you" is always the author of the previous article.
As for me referring to 9.4, a search of the archives for "Randy Webb
9.4" turns up one post and this is the entire body of it:

<quote>
Major change: MSDN URL's that were redirect pages were changed to the
destination page.
</quote>

So I am not sure where you got "9.4 contains". Somewhere in the two
threads about 9.3 I probably did say "9.3 contains" though.

I wrote ''Recently you wrote "9.4 contains" or similar.''. The Subject
of the article which you wrote and found was "FAQ 9.4 Updated" which is
semantically similar. Don't quibble.


I have an email from Jim where I asked him about moving files out of
the faq folder into the faq\old folder to try to clean up the folder
some (it has a lot of the old faq documents there). His response, which
I totally agree with, was "I don't like ever changing URI's which
exist" and faq.css is part of that URL so until 10.0 comes out it will
stay as faq.css but I don't see where it makes any difference what the
name of the external file is and for the sake of knowing - on the
server - what it goes to, it will probably stay named faq.css.

But that "faq.css" is not a URL expected to be cited anywhere but in the
FAQ itself.
If you want to rename it for your local copy then feel free to. You
have said in the past that you have named the HTML file differently.
Just edit the code to match your CSS file name.


See above about changing file names.

Bad naming, or naming structure now seen to be sub-optimal, should not
be perpetuated. The server can AIUI redirect requests for the old name,
and one can back that up with
<META HTTP-EQUIV="REFRESH" CONTENT="1; URL= ...

After all, it's illogical to suggest that no URL can be changed when the
document at that URL can be substantially rewritten. There is AFAIK no
advertised public interface to all previous versions of the FAQ.

I am not sure why the Monday/Wednesday/Friday postings are not made,
that would be up to Bart to answer. It is just as easy for me to update
the mon/wed/fri text files when I change the index file so that the
text files stay updated. That is the major reason I am even going to
write a .wsf and .xml file is so the text postings can continue.

Nevertheless, the FAQ is currently telling lies on the subject. You
only need to change "will currently" (always was semantically bad
anyway; "is currently") to "has been and may in future be".

I don't see the need to post all of Quick Answers twice a week nowadays;
it could be split into two similar-sized parts & posted separately.

However, Bart provides a daily post with FAQ in its Subject and the FAQ
URL in its body, and everything in the FAQ appears in those posts. So
the weekly full-FAQ post is not so necessary now. (He does not put his
name in it, and I've forgotten which Bart he is. BVdD not BL I guess.)


Where? I just looked at http://jibbering.com/faq/faq.css and the *only*
problem I see with it is a comment delimiter problem. I am not going to
re-upload a new file to fix that problem until you have a chance to
tell me where in that file you find an "item" that doesn't have an
ending semicolon as I don't fine one.

There should be a semicolon added before EVERY occurrence of the
character "}", obviously before the preceding whitespace. That will be
at the end of the last of each of a set of consecutive items.

Also, faq.css should have, in comment, some identifying material.
 
R

Randy Webb

Dr J R Stockton said the following on 12/22/2006 8:45 AM:
In comp.lang.javascript message <[email protected]>,
Dr J R Stockton said the following on 12/21/2006 10:36 AM:
In comp.lang.javascript message
<[email protected]>, Wed, 20 Dec 2006 00:00:01,

FAQ Topic - How do I get the value of a form control?

In HTML documents, named forms may be referred to as named
properties of the ‹ document.forms › collection, and named form
controls may be referred to as named properties of the form's
elements collection:

var frm = document.forms["formname"];
var contrl = frm.elements["elementname"];
Status of document.formname & frm.elementname ?

Your question is vague when you ask about the status. Are you asking
what the status of the document.formname convention is? The FAQ code
uses bracket notation because it has fewer side effects than dot
notation. <form name="my-form"> doesn't work with dot notation. If
that isn't what you are asking, then I am not sure what you are asking.

I'm not asking anything. I'm suggesting that there should be a mention
of that convention and its applicability. Obviously it can only be
applicable where elementname's "spelling" is compatible; but it's not
obvious how widely it is usable. Those who use MSIE themselves may -
should - wish to know whether it is usable in near-enough all current
systems.

You have the ? at the end so you were asking something and I obviously
mis-understood what you were asking.

As for it being documented that document.formname & frm.elementname are
available, it is covered in the Notes page that is linked to from that
entry. And within the first page and a half of the Notes document it
says this:

/* The latter, bracket notation, does not impose the same restrictions
on the character sequence used for the name as is imposed by the
preceding dot notation, which is restricted to only using character
sequences that would fulfil the ECMAScript definition of an
identifier.

Bracket notation is often preferred when accessing form elements as
it helps to document itself by making it clear in the source code
which property names originate in the HTML rather than the DOM.
*/

Without putting that comment directly in the FAQ, I don't see how it
could be any more documented than it already is.
Their presence implies that they are necessary, which they are not.

In that scenario, no they are not necessary. But having the parentheses
as a matter of habit is a better practice than not having them ever will
be.
A faulty explanation is not improved by mere repetition.

Not accepting an explanation does not make it faulty. And repeatedly
quibbling about the same thing over and over again does no good.

For the record: I am not removing the parentheses from that code.
Disregard who *can* currently maintain the Notes - anyone can, if they
can persuade Jim to let them. The question is one of whether anyone -
and if so, who - is actually maintaining each Note.

<eyeroll> Repeating the same arguments over and over isn't going to
change my mind. Until someone else actively starts changing the Notes
pages, I have no choice but to believe that the only people capable of
(even if they aren't) maintaining them are Jim, Richard and myself. And
documenting that in the Notes pages is not going to happen any time soon
for the reasons I have already stated to you at least twice already.
And how do you expect a FAQ user to read that string? Anyway, d.lM is
the date of last upload; a maintainer should be able to silently correct
such as spelling mistakes without publicly showing that it is a new
"version".

I am not going to date and version the FAQ Notes pages. You can request
all you want to but I am not going to do it. It's a waste of time.
Using a few simple Batch tools, I see that there are only about 49
distinct sites cited. Many of those you will instantly recognise - W3,
merlyn, jibbering, oreilly, sun, wipo, mozilla, davidflanagan,
wikipedia, microsoft, galasoft, google, ietf, apple, ecma for example.

Yes, I recognize every one of them, but it isn't what I offered to do. I
am not going to review every one of them for a label to each link. After
10.x gets released, if you want to create a list of all the links with
possible labels, and it is feasible, I will be glad to incorporate it
into the document.

Default "you" is always the author of the previous article.

Then "you", in your statement, would be referring to FAQServer which has
*never* even come close to saying that. So, I assumed you were
referring to me but I am not the author of the previous article in this
thread that you replied to to make that statement.
I wrote ''Recently you wrote "9.4 contains" or similar.''. The Subject
of the article which you wrote and found was "FAQ 9.4 Updated" which is
semantically similar. Don't quibble.

You complain about me posting "9.4 contains" when I didn't even come
close to saying that. Rather than just admitting a mistake you accuse me
of quibbling about you making a blatantly false statement? You amaze me
sometimes.

<snipped section on file renaming>

File renaming on the jibbering.com server is very plain and simple. I am
not going to start renaming files simply because you think they need to
be renamed. It's not happening. You can reply back and post as many
times as you want to about it and it still won't change the fact that I
am not going to do it.
After all, it's illogical to suggest that no URL can be changed when the
document at that URL can be substantially rewritten. There is AFAIK no
advertised public interface to all previous versions of the FAQ.

That is very true and the email I got from Jim was directly related to
moving all the old FAQ files to the old folder (along with some other
files). The intentions, with 10.x, is to have a link to <URL:
http://jibbering.com/faq/old/> which is all of the old FAQ files
(AFAIK). The other files in the faq folder (mostly .asp/.html files) are
going to stay where they are.

Nevertheless, the FAQ is currently telling lies on the subject. You
only need to change "will currently" (always was semantically bad
anyway; "is currently") to "has been and may in future be".

<proposal>

The FAQ is currently posted one section daily for review, questions
and a reminder that the FAQ is available.

</proposal>

The wording needs to be changed some but it is a start. Thoughts?
I don't see the need to post all of Quick Answers twice a week nowadays;
it could be split into two similar-sized parts & posted separately.

That would be up to Bart and how easily it could be set up to do it. I
can produce the text versions easily enough though.
However, Bart provides a daily post with FAQ in its Subject and the FAQ
URL in its body, and everything in the FAQ appears in those posts. So
the weekly full-FAQ post is not so necessary now. (He does not put his
name in it, and I've forgotten which Bart he is. BVdD not BL I guess.)

Yes, it is Bart Van der Brock that does the daily postings.

There should be a semicolon added before EVERY occurrence of the
character "}", obviously before the preceding whitespace.

If you say it should be there, then by what specification do you base
that statement on? Unless there is some specification that says they
should be there - and that the W3C validator gets it wrong - then there
is nothing wrong with the faq.css file.

Also, faq.css should have, in comment, some identifying material.

Such as?

It currently has a comment at the beginning that identifies who wrote
the original. If RobG wants recognition then I will add it.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>,
You complain about me posting "9.4 contains" when I didn't even come
close to saying that. Rather than just admitting a mistake you accuse
me of quibbling about you making a blatantly false statement? You amaze
me sometimes.

The whole article contained "FAQ 9.4 Updated" which is substantively
similar. It implies, to its readers, the existence of a visible FAQ
9.4.


Surely, Bart never posted them? Was it not a CRON job at jibbering?



That would be up to Bart and how easily it could be set up to do it. I
can produce the text versions easily enough though.

Why would it be up to Bart? He posts fragments.

If you say it should be there, then by what specification do you base
that statement on? Unless there is some specification that says they
should be there - and that the W3C validator gets it wrong - then there
is nothing wrong with the faq.css file.

I wrote "generally accepted"; I did not write "specification". To learn
good CSS style, participate in the appropriate newsgroup.

Such as?

It currently has a comment at the beginning that identifies who wrote
the original. If RobG wants recognition then I will add it.

That would be courteous. But it is more important to identify the
purpose of faq.css - to say that it is the css for the CLJ FAQ. Six
years ago it started :

/*
EXAMPLE CLJ FAQ CSS - VALIDATES BUT WITH WARNINGS
CSS by Andrew Urquhart - http://andrewu.co.uk
Minor changes by (e-mail address removed)
*/
 
R

Randy Webb

Dr J R Stockton said the following on 12/24/2006 7:23 AM:
In comp.lang.javascript message <[email protected]>,


The whole article contained "FAQ 9.4 Updated" which is substantively
similar. It implies, to its readers, the existence of a visible FAQ
9.4.

The very first line of the FAQ reads:

comp.lang.javascript FAQ - 9.4 - 2006-12-21

So I fail to see how it is not a "visible FAQ 9.4" although I did have
problems uploading it the night I made that post on the 19th and it was
2 days before I got it sorted out. It is ironic that you would wait this
long to quibble about it instead of asking about it when I made the
original post though.
Surely, Bart never posted them? Was it not a CRON job at jibbering?

No, Bart has never posted them. Yes, it was a CRON job at jibbering. And
all postings from CRON jobs at jibbering ceased at the same time. It is
the reason that Bart now makes the postings and not jibbering. Jim
couldn't find an appropriate news server to allow the postings from
jibbering (although I don't remember the exact problem). If someone can
write a server script that can automate my Giganews account then it can
be run from jibbering without a problem. Or, if someone can tell me how
to automate it locally here using Thunderbird (or any other decent
newsreader/program) then I can automate the text postings myself.
Why would it be up to Bart? He posts fragments.

Because, to date, Bart is the only one that has started making automated
postings and since he has the appropriate account it would only make
sense that if he is already making daily postings that he might be
persuaded to make the weekly postings. My intent was not to say it was
Bart's responsibility - it isn't - it was a badly worded response.
I wrote "generally accepted"; I did not write "specification". To learn
good CSS style, participate in the appropriate newsgroup.

I already know how to produce "good CSS" and I don't care for the overly
pedantic "style" pushed in ciwas. There is nothing wrong with the
faq.css file and I see no need - other than an exercise in wasting time
- of adding a semicolon to every empty line.
That would be courteous. But it is more important to identify the
purpose of faq.css - to say that it is the css for the CLJ FAQ. Six
years ago it started :

/*
EXAMPLE CLJ FAQ CSS - VALIDATES BUT WITH WARNINGS
CSS by Andrew Urquhart - http://andrewu.co.uk
Minor changes by (e-mail address removed)
*/

The only thing that has changed is that it now validates - without
warnings - and that RobG modified it.

The comment block now reads:

/*
CLJ FAQ CSS - VALIDATES
CSS by Andrew Urquhart - http://andrewu.co.uk
Minor changes by (e-mail address removed)
Modified extensively by RobG
*/

in my local copy that will get uploaded if there are no objections to
it. I am not sure who else has modified it in the past. Probably Richard
(although I am not positive) and I have modified what Rob sent me
(removing the comment delimiter and the CSS code before it). As it is
now it is almost exclusively a document produced by RobG though.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>,
The very first line of the FAQ reads:

comp.lang.javascript FAQ - 9.4 - 2006-12-21

So I fail to see how it is not a "visible FAQ 9.4" although I did have
problems uploading it the night I made that post on the 19th and it was
2 days before I got it sorted out. It is ironic that you would wait
this long to quibble about it instead of asking about it when I made
the original post though.

Remember to allow time for me to read your original post, to find that
the page was not there, and to comment on the matter. Note that the
comment was intended to correct your future practice, not your past
deeds. FAQ 9.4 was not visible for a while after you cited it.

I already know how to produce "good CSS" and I don't care for the
overly pedantic "style" pushed in ciwas. There is nothing wrong with
the faq.css file and I see no need - other than an exercise in wasting
time - of adding a semicolon to every empty line.

Then you do not understand why such a semicolon is recommended.
 
R

Randy Webb

Dr J R Stockton said the following on 12/25/2006 8:00 AM:
In comp.lang.javascript message <[email protected]>,


Remember to allow time for me to read your original post, to find that
the page was not there, and to comment on the matter.

You didn't read it though as you mis-quoted what I said. And your post
said nothing about it not being there, you quibbled about me supposedly
saying "contains" and not "will contain" (or similar).
Note that the comment was intended to correct your future practice,
not your past deeds. FAQ 9.4 was not visible for a while after you cited it.

Again, that is not what you said. You are wiggling.
Then you do not understand why such a semicolon is recommended.

I will ask again, and you can avoid it again, but who recommends it?
And, I would like a credible standards body that recommends using
semicolons on a line that only contains a closing }. I don't want JRS'
recommendation, or anybody in ciwas, I want a standards body. Otherwise,
you are just babbling to have something to complain about.
 
V

VK

Randy said:
And, I would like a credible standards body that recommends using
semicolons on a line that only contains a closing }. I don't want JRS'
recommendation, or anybody in ciwas, I want a standards body. Otherwise,
you are just babbling to have something to complain about.

The "standard body" (in its regular mumbling way but still
recognizable) says: "Screw on JRS!"

<http://www.w3.org/TR/REC-CSS2/syndata.html#q8>
<quote>
A declaration-block (also called a {}-block in the following text)
starts with a left curly brace ({) and ends with the matching right
curly brace (}). In between there must be a list of zero or more
semicolon-separated (;) declarations.
</quote>
See "semicolon-separated" - not "ended by semicolon".

See also the proposed formatting at:
<http://www.w3.org/TR/REC-CSS2/syndata.html#declaration>
 
V

VK

The "standard body" (in its regular mumbling way...

I especially like the passage "there must be a list of zero ...
declarations". Every time I'm going to W3C there is always to surprise
me to laughing.
 
D

Dr J R Stockton

In comp.lang.javascript message said:
Dr J R Stockton said the following on 12/25/2006 8:00 AM:

You didn't read it though as you mis-quoted what I said. And your post
said nothing about it not being there, you quibbled about me supposedly
saying "contains" and not "will contain" (or similar).

Good : that shows that you have recognised the point. It only remains
for you to understand its significance.

Don't talk about something - in this case an upload - that you have not
yet achieved as if it were a done thing. It's on the same footing as
the idea that a peaceful democracy would result from the events of
Spring 2003.

I will ask again, and you can avoid it again, but who recommends it?
And, I would like a credible standards body that recommends using
semicolons on a line that only contains a closing }.

I have not said that the standards require a semicolon after the last
item; I have said that it is recognised as good practice. Ask in ciwas,
and if you are deemed worthy you will be told why that is so.

The semicolon should NOT be on a line containing only a closing
semicolon; it should be at the end of the last item - either contiguous,
or separated by a space. There is no reason for putting a semicolon in
any otherwise-empty CSS line.
 
R

Randy Webb

Dr J R Stockton said the following on 12/27/2006 9:09 AM:
Good : that shows that you have recognised the point.

The point being that you are quibbling about nothing?
It only remains for you to understand its significance.

Not much of what you say to me has a lot of long term significance.
Don't talk about something - in this case an upload - that you have not
yet achieved as if it were a done thing. It's on the same footing as
the idea that a peaceful democracy would result from the events of
Spring 2003.

In the future, I will start including a proviso to satisfy your pedantic
desires about my wording. Have you noticed that nobody else even
mentioned it? They probably used common sense and figured something
happened.....
I have not said that the standards require a semicolon after the last
item; I have said that it is recognised as good practice. Ask in ciwas,
and if you are deemed worthy you will be told why that is so.

I don't need ciwas to "deem me worthy" to explain to me why it is a
"Good Practice" to put a semicolon on a blank line or one that has only
a closing brace. It's a waste of time and I won't do it.
The semicolon should NOT be on a line containing only a closing
semicolon; it should be at the end of the last item - either contiguous,
or separated by a space. There is no reason for putting a semicolon in
any otherwise-empty CSS line.

And this is an "otherwise-empty CSS line":

}

I am *not* putting semicolons in those lines simply to satisfy the
desires of the ciwas regulars. If I were going to start adding
semicolons where they aren't required to satisfy regulars, I would start
with JS code and I don't do it there and I won't do it in CSS code.

Now, unless you have something significant to add about the FAQ entry
about how to get the value of a form control then I will consider this
thread ended and anything else added will be you quibbling some more.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>,
}

I am *not* putting semicolons in those lines simply to satisfy the
desires of the ciwas regulars.

They would not want you to do so. They would want you to put them
directly after the last item. If they were merely preceding the closing
brace, they would not serve the intended purpose.

Indeed, as I originally wrote, "It is generally accepted that in CSS
every "item" (such as "COLOR: #000000;") should have a final semicolon,
even if it is the last of its set."

For example, there should be one in the position marked by # :


A:link {
COLOR: blue; TEXT-DECORATION: underline#
}
 
R

Randy Webb

Dr J R Stockton said the following on 12/28/2006 6:21 PM:
In comp.lang.javascript message <[email protected]>,


They would not want you to do so. They would want you to put them
directly after the last item. If they were merely preceding the closing
brace, they would not serve the intended purpose.

Indeed, as I originally wrote, "It is generally accepted that in CSS
every "item" (such as "COLOR: #000000;") should have a final semicolon,
even if it is the last of its set."

For example, there should be one in the position marked by # :


A:link {
COLOR: blue; TEXT-DECORATION: underline#
}

I refer you to my post where I asked you to quote a line of the faq.css
file that shows that style coding (after I reviewed it myself) and there
are none that I see. If you are seeing them then you are viewing an old
file and need to retrieve it again from the server.

As the above code doesn't appear in <URL:
http://jibbering.com/faq/faq.css> then I have to assume that you are
either looking at an old file or making up an example to back your claim
that something should be done when in fact it *is* being done that way
in the faq.css file.
 
J

John G Harris

Dr J R said:
In comp.lang.javascript message <[email protected]>,


They would not want you to do so. They would want you to put them
directly after the last item. If they were merely preceding the closing
brace, they would not serve the intended purpose.

Indeed, as I originally wrote, "It is generally accepted that in CSS
every "item" (such as "COLOR: #000000;") should have a final semicolon,
even if it is the last of its set."

As in Pascal, leaving out trailing semicolons indicates an understanding
of the language.

As in
if (a == true)
in javascript, adding redundant characters doesn't guarantee a lack of
understanding, but it's a possibility. If it's done to reduce the number
of typing errors then that's the author's decision.

Either way, there is no good reason to alter a working file.

For example, there should be one in the position marked by # :


A:link {
COLOR: blue; TEXT-DECORATION: underline#
}

The positioning of the curly brackets is horrible, but not enough to ask
for changes in a working CSS file.


Isn't it about time that discussion of the presentation of the FAQ pages
took place in a separate thread.

John
 
D

Dr J R Stockton

In comp.lang.javascript message said:
Dr J R Stockton said the following on 12/28/2006 6:21 PM:

I refer you to my post where I asked you to quote a line of the faq.css
file that shows that style coding (after I reviewed it myself) and
there are none that I see. If you are seeing them then you are viewing
an old file and need to retrieve it again from the server.

As the above code doesn't appear in <URL: http://jibbering.com/faq/faq.
css> then I have to assume that you are either looking at an old file
or making up an example to back your claim that something should be
done when in fact it *is* being done that way in the faq.css file.

<URL: http://jibbering.com/faq/faq.css> indeed contains

a:link {
color : blue;
text-decoration : underline;
}

with line feeds and semicolons as shown (leading tabs added by me).

It is not, however, the CSS file that was served to me on December 24th
at about 18:48 GMT when I downloaded the FAQ from jibbering.

Of course, if you followed good document-handling practice and put your
name and the date in the files that you publish, it would be much easier
to see what is happening.

The copy fetched by using that URL has /* on line 1 and */ on lines 5 &
31; and no other asterisk. If the W3 validator does not report that as
an error, it needs fixing.

To facilitate *end-to-end* checking that what others see is what you
think that they should see, the visible date and version number suffices
for the FAQ text. Perhaps it would be well to include a version
indicator in the CSS code proper (i.e. not comment); colour would be
easy enough, or by using something developed from
<pre>01234567890
<div style="padding-left:3.65ex">^</div></pre>
 
R

Randy Webb

Dr J R Stockton said the following on 12/31/2006 6:21 AM:
<URL: http://jibbering.com/faq/faq.css> indeed contains

a:link {
color : blue;
text-decoration : underline;
}

with line feeds and semicolons as shown (leading tabs added by me).

Which is what I have said the entire time.
It is not, however, the CSS file that was served to me on December 24th
at about 18:48 GMT when I downloaded the FAQ from jibbering.

Then it is an intermediate cache issue as the FTP Date on the
jibbering.com server for faq.css is December 16 2006 so nothing I can
possibly do about it myself.
Of course, if you followed good document-handling practice and put your
name and the date in the files that you publish, it would be much easier
to see what is happening.

It wouldn't have solved your issue now other than to have removed
something you could quibble about. Had you checked the FTP Upload date
you would have known you had an old outdated file.
The copy fetched by using that URL has /* on line 1 and */ on lines 5 &
31; and no other asterisk. If the W3 validator does not report that as
an error, it needs fixing.

It does report it as an error (which I also said to start with) as that
being the only error/problem reported by the CSS Validator at the W3C site.
To facilitate *end-to-end* checking that what others see is what you
think that they should see, the visible date and version number suffices
for the FAQ text.

Yes. And with 10.0 I will look at adding a version number to the faq.css
file and having the FAQ reflect that version number.
Perhaps it would be well to include a version indicator in the CSS code
proper (i.e. not comment); colour would be easy enough, or by using
something developed from

Section 5 now says:

The FAQ uses the stylesheet faq.css.....

Where faq.css is a link to the file. I will look into adding a version
number to the faq.css file itself (that is trivial) and adding it to the
FAQ itself so that it would read "The FAQ uses the stylesheet faq.css
version #.##" so that would be easy to tell if you got a cached version
or not. Although I personally think it is a waste of time to do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,244
Members
46,838
Latest member
KandiceChi

Latest Threads

Top