473,326 Members | 2,175 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,326 software developers and data experts.

Moving to 4.01 strict: problem with hidden fields et al.

Dear all

Following the oft-repeated advice here and ciwas I have made my site
nearly 4.01 strict (working on it). There are some items on which I would
appreciate your advice:

1. Hidden fields
http://www.zoo.co.uk/~mmenterprises/contact.htm
I am using FormMail from Matt's Script Archive. The W3C validator
objected to the hidden fields unless I put, say, P round them. That gave
me unwanted blank lines. So I put a DIV round them and styled them as
display: none but that seems too much like a kludge! What is the cleaner
way to handle hidden form fields?

2. Images do not flow
http://www.zoo.co.uk/~mmenterprises/kgs/index.html
I had a whole lot of small images one after the other with no gaps. I was
aiming for a fluid design and I expected them to wrap. Instead they
formed one huge long horizontal line. So I put a space between each image
then they behaved as expected. However I would like to use border
properties instead of spaces. Is there a way to make them wrap without
inserting the space?

3. Free counter
Any page (e.g. the above cited)
The HTML fragment from the free webcounter does not validate. I can fix
the border and target attributes but what suggestions do you have for for
language="JavaScript"? Apart from remove the javascript completely?

4. Any other comments or suggestion?
Apart from get rid of tables for layout and improve my alt tags. What
else should would be good to do?

Many thanks

Mark.

--
M&M Enterprises Http://www.mmenterprises.co.uk/
"You cannot change the past but you can shape the future"

Jul 23 '05 #1
10 3082
Mark McLellan <ma***********@mmenterprises.co.uk> wrote:
Following the oft-repeated advice here and ciwas I have made my site
nearly 4.01 strict (working on it).
Actually there are two schools on this. My school says that it's important
to write logical markup and separate structure and content from visual
appearance, as far as feasible. This normally means using Strict, but
that's not the goal, just a side effect.
1. Hidden fields
http://www.zoo.co.uk/~mmenterprises/contact.htm
I am using FormMail from Matt's Script Archive.
Gasp. You mean the original unreliable version that is a serious security
threat? But that's a different issue.
The W3C validator
objected to the hidden fields unless I put, say, P round them.
Indeed. Part of being Strict is the requirement of putting all "inline
elements" inside block level containers. A bit silly if you ask me, though
it's _mostly_ a useful principle. But there's little point in it as regards
to form fields for example.
That gave me unwanted blank lines.
You could suggest a different rendering by using CSS. But why did you
use P? It's really not a paragraph in any sensible interpretation of the
word.
So I put a DIV round them and styled them
as display: none
That's not needed since hidden fields aren't displayed anyway (by default
that is - and if a browser wanted to display them for some strange reason,
we had better not interfere).
but that seems too much like a kludge!
So the display: none part is not needed. The DIV markup isn't a kludge,
unless you regard the "blocking" principle of Strict itself a kludge.
When you have no logical alternative and you need (or want) to make
something a block, DIV is the only sensible alternative. And it could even
be logical in a sense, for grouping hidden fields together.

Now that I look at your markup, you seem to have made each hidden field a
paragraph, which may imply some spacing in rendering, and therefore you
have wrapped them inside a DIV with display: none. But that's not needed:
you can simply use <div><input ...><input ...>...<input ...></div>.
2. Images do not flow
http://www.zoo.co.uk/~mmenterprises/kgs/index.html
I had a whole lot of small images one after the other with no gaps. I
was aiming for a fluid design and I expected them to wrap. Instead they
formed one huge long horizontal line.
That's a bit surprising, since images normally wrap even when you have no
spaces between them (<img ...><img ...>). But it seems that this does not
happen if the images are inside a table cell!

So this is not directly related to Strict vs. Transitional, except in the
sense that if you applied the "spirit of Strict", you wouldn't use a table
for layout and you would avoid the problem. :-) (Strict does not disallow
layout tables of course, but the idea of Strict is, in part, to
delegate presentation to style sheets.) Seriously, I think the use of a
table is not very serious here, and replacing it by CSS would be a major
effort.

It seems that if you set
td img { float: left; }
in a style sheet, the presentation becomes what you want - though you need
to take care of stopping the floating after a string of images, e.g.
with <br style="clear:both"> (that's the nominally Strict way of saying
<br clear="all">).
3. Free counter
Counters considered harmful.
The HTML fragment from the free webcounter does not validate.
TANSTAAFL. :-)
I can fix
the border and target attributes but what suggestions do you have for
for language="JavaScript"? Apart from remove the javascript completely?
You can remove the language attribute, and need to do so if you wish to
comply with Strict rules. Removing it has no effect, since browsers that
support scripting use JavaScript as the default scripting language anyway.
The only need for the language="..." attribute is in the rare situations
where you wish to distinguish between different versions of JavaScript.
4. Any other comments or suggestion?
Apart from get rid of tables for layout and improve my alt tags. What
else should would be good to do?


As I wrote, I wouldn't regard layout tables as a big problem here. I don't
think the alt attributes for the photos can be made essentially better
(though this depends on whether codes like b1, b2, ... have some
informative value to a person who does not see the images - I cannot guess
what the codes are). For the counter, there's no good alt text, but
"Visited by fastcounter people since 17 March 1996"
is fairly odd; alt="some number of" would make more sense.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #2
Mark McLellan wrote:
Dear all

Following the oft-repeated advice here and ciwas I have made my site
nearly 4.01 strict (working on it). There are some items on which I would
appreciate your advice:

1. Hidden fields
http://www.zoo.co.uk/~mmenterprises/contact.htm
I am using FormMail from Matt's Script Archive. The W3C validator
objected to the hidden fields unless I put, say, P round them. That gave
me unwanted blank lines. So I put a DIV round them and styled them as
display: none but that seems too much like a kludge! What is the cleaner
way to handle hidden form fields?
#1 Don't use Matt's script. It's insecure allowing spammers to bounce
mail off of the server you use.

#2 Read the specs about the errors you see. You will find that <input>
is an inline element that must be enclosed within a block level element.
The recommended element for form elements is <fieldset> but <div> or
<p> (<input> is not a paragraph though) will work. I sometimes use
fieldset and set it to not display the default border.

2. Images do not flow
http://www.zoo.co.uk/~mmenterprises/kgs/index.html
I had a whole lot of small images one after the other with no gaps. I was
aiming for a fluid design and I expected them to wrap. Instead they
formed one huge long horizontal line. So I put a space between each image
then they behaved as expected. However I would like to use border
properties instead of spaces. Is there a way to make them wrap without
inserting the space?
I'm not sure what images you are referring to. Place them in 100% wide
<div>s?

3. Free counter
Any page (e.g. the above cited)
The HTML fragment from the free webcounter does not validate. I can fix
the border and target attributes but what suggestions do you have for for
language="JavaScript"? Apart from remove the javascript completely?
language is deprecated. You are already using the correct attribute,
type; that's all that's needed.

4. Any other comments or suggestion?
Apart from get rid of tables for layout and improve my alt tags. What
else should would be good to do?

Many thanks

Mark.


Do some google searching on "list links css." You can get rid of those
ugly | between links in your menu. It sounds like you've already
decided on some other correct improvements/changes (table,alt attributes).

One other suggestion. It looks like you may be doing already. Read
read read; the recommendations, this newsgroup, alt.html, ciwas
(stylesheets), books, tutorials, whatever.

--
Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
Webmaster/Computer Center Manager, NMSU at Alamogordo
Cooordinator, Tularosa Basin Chapter, ABATE of NM; AMA#758681; COBB
'94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg
A zest for living must include a willingness to die. - R.A. Heinlein
Jul 23 '05 #3
Uncle Pirate <st**@surecann.com> wrote:
The recommended element for form elements is <fieldset> but <div> or
<p> (<input> is not a paragraph though) will work.


I haven't noticed any specific recommendation on using <fieldset> in
general in W3C material. However there are clearly situations where it is
most adequate logically, like for grouping a set of radio buttons.
It would be odd to use it e.g. if you have just one hidden field.

Moreover, the <legend> element is obligatory in <fieldset>, making it
rather unsuitable for hidden fields. (You can use empty content there,
<legend></legend>, but the markup might still affect rendering.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #4
Jukka K. Korpela wrote:
Uncle Pirate <st**@surecann.com> wrote:

The recommended element for form elements is <fieldset> but <div> or
<p> (<input> is not a paragraph though) will work.

I haven't noticed any specific recommendation on using <fieldset> in
general in W3C material. However there are clearly situations where it is
most adequate logically, like for grouping a set of radio buttons.
It would be odd to use it e.g. if you have just one hidden field.


Wrote without checking. Let me rephrase; I've seen it recommended by
some to use <fieldset>. A <div> may well be more appropriate in instances.

Moreover, the <legend> element is obligatory in <fieldset>, making it
rather unsuitable for hidden fields. (You can use empty content there,
<legend></legend>, but the markup might still affect rendering.)


True. I've used empty or just a space (don't remember off hand) for the
<legend> element. Typically, when using <fieldset>, I group a number of
fields within. Rarely, do I find one hidden field to be very useful;
usually, I group several within a <fieldset>. What would be nice is if
<fieldset> were rendered much like a table; I've resorted to tables to
display form input as it makes for an easy columnar layout for the
labels and input fields. I've also used divs to make a columnar layout,
but then there is the problem of maintaining a row's proper display.

--
Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
Webmaster/Computer Center Manager, NMSU at Alamogordo
Cooordinator, Tularosa Basin Chapter, ABATE of NM; AMA#758681; COBB
'94 1500 Vulcan (now wrecked) :( http://motorcyclefun.org/Dcp_2068c.jpg
A zest for living must include a willingness to die. - R.A. Heinlein
Jul 23 '05 #5
Tim
Mark McLellan <ma***********@mmenterprises.co.uk> wrote:
but what suggestions do you have for for language="JavaScript"? Apart
from remove the javascript completely?

"Jukka K. Korpela" <jk******@cs.tut.fi> posted:
You can remove the language attribute, and need to do so if you wish to
comply with Strict rules. Removing it has no effect, since browsers that
support scripting use JavaScript as the default scripting language anyway.
The only need for the language="..." attribute is in the rare situations
where you wish to distinguish between different versions of JavaScript.


Noticing that the page mentions type="text/javascript" as well as using a
language attribute, but your comment about JavaScript being the default
language for browsers seems to be suggesting there's no need to bother
specifying the script as being JavaScript on the page. Wouldn't not
specifying the scripting language be a bit of a kludge? (Relying on
*current* browser behaviour.) In the future, if the page is around long
enough, something else might be the default.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Jul 23 '05 #6
Tim wrote:
You can remove the language attribute, and need to do so if you wish to
comply with Strict rules. Removing it has no effect, since browsers that
support scripting use JavaScript as the default scripting language anyway.
The only need for the language="..." attribute is in the rare situations
where you wish to distinguish between different versions of JavaScript.


Noticing that the page mentions type="text/javascript" as well as using a
language attribute, but your comment about JavaScript being the default
language for browsers seems to be suggesting there's no need to bother
specifying the script as being JavaScript on the page. Wouldn't not
specifying the scripting language be a bit of a kludge? (Relying on
*current* browser behaviour.) In the future, if the page is around long
enough, something else might be the default.


I agree. Relying on default behavior is bad practice.

If one is in doubt, you can always consult the HTML 4.01 spec, which, in
section 18.2.1, "The SCRIPT element", referring to the type atrribute of
the <script> tag, says:

"This attribute specifies the scripting language of the element's
contents and overrides the default scripting language. The scripting
language is specified as a content type (e.g., "text/javascript").
Authors must supply a value for this attribute. There is no default
value for this attribute."

Note the spec says "Authors MUST supply a value..."

In section 18.2.2, "Specifying the scripting language", the spec states:

"Authors should specify the default scripting language for all scripts
in a document by including the following META declaration in the HEAD:"

<META http-equiv="Content-Script-Type" content="<type>">

where <type> is one of "text/javascript", "text/vbscript", etc.

Note here the keyword is SHOULD, not MUST.

NM

--
convert uppercase WORDS to single keystrokes to reply
Jul 23 '05 #7
Mark McLellan wrote:
[...]
1. Hidden fields [...] So I put a DIV round them and styled
them as display: none but that seems too much like a kludge! What is
the cleaner way to handle hidden form fields?


Additionnally to Jukka's and others' posts: Usually there are existing
containers for the visible fields, so why not just put the hidden fields in
one of those:

<form>
<p>
Name: <input type="text" name="thename">
</p>
<p>
<input type="hidden" name="whatever" value="whatever value">
<input type="hidden" name="onemore" value="one more">
<input type="submit" name="submit" value="Send data">
</p>
</form>

HTH
Markus
Jul 23 '05 #8
Tim <ti*@mail.localhost.invalid> wrote:
You can remove the language attribute, and need to do so if you wish
to comply with Strict rules. Removing it has no effect, since browsers
that support scripting use JavaScript as the default scripting
language anyway. The only need for the language="..." attribute is in
the rare situations where you wish to distinguish between different
versions of JavaScript.
Noticing that the page mentions type="text/javascript" as well as using
a language attribute, but your comment about JavaScript being the
default language for browsers seems to be suggesting there's no need to
bother specifying the script as being JavaScript on the page.


I addressed the problem of the language attribute. I didn't comment on the
type attribute, since it's not a problem. It's actually needed according to
the formal syntax.
Wouldn't
not specifying the scripting language be a bit of a kludge? (Relying
on *current* browser behaviour.)


Actually, the type attribute is a useless kludge (though I did not and I do
not say that it should not be used - it's a harmless formality). It is
useless since it (unlike language) does not allow the language _version_ to
be specified. It is a kludge because we have been told to use
"text/javascript", which is an _unregistered_ media type, hence incorrect
since the subtype does not begin with "x-". I wonder how the W3C expects us
to take their recommendations seriously when they themselves take the IETF
procedures this way - they even used the mediatype "text/css" for years
before bothering to register it at IANA.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #9
On Sun, 16 Jan 2005 21:12:37 +0000, Jukka K. Korpela wrote:
You can remove the language attribute, and need to do so if you wish to
comply with Strict rules. Removing it has no effect, since browsers that
support scripting use JavaScript as the default scripting language anyway.
The only need for the language="..." attribute is in the rare situations
where you wish to distinguish between different versions of JavaScript.


According to http://www.ietf.org/rfc/rfc2045.txt , we CAN specify
parameters in a content type declaration. I move that we standardize
"version" as such an acceptable parameter for text/javascript

<script type="text/javascript; version=1.3">
alert("I'm using JavaScript 1.3!");
</script>

Anyone have any other suggestions?

La'ie Techie

Jul 23 '05 #10
=?UTF-8?b?TMSByrtpZSBUZWNoaWU=?=
<laie@win_remove_get_nospam_solutions.com> wrote:
According to http://www.ietf.org/rfc/rfc2045.txt , we CAN specify
parameters in a content type declaration.
Yes, to the extent that the definition (specification) of the content type
permits that.
I move that we standardize
"version" as such an acceptable parameter for text/javascript


I don't think c.i.w.a.h. is formally or factually competent to decide on
such matters.

Besides, the type text/javascript itself has not been registered. Using it
is a violation of RFC 2045. _If_ it were registered, the registration might
define parameters. And then you would just allow eight years for browser
vendors to consider implementing that.

ObHTML: even the type text/html has no parameters; instead, deciding on
language version is in practice based on grotesque doctype sniffing.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ryann | last post by:
Hello. I am creating a form that has 5 steps/pages. Each page contains about 20 fields. But I don't want to write them until they submit on the last page. I figured out that I can use hidden...
1
by: mark.reichman | last post by:
First off.. Thanks to Grant Wagner for help in a previous thread related to this one. I am at a total loss... I have multiple fields in a form with the same name. Lets call the fields with the...
4
by: Fred | last post by:
Hi, i know how to pass a value from Javascript to ASP with a hidden field into a form and submitting it, or with cookies, but here i have to pass a lot of data in an array. There is a list of...
1
by: Sam Wuebben | last post by:
I would like to add a few hidden field values to a form as it is submited via JavaScript. I have a static page shopping site that uses MIVA shopping cart. Some of the pages are getting quite...
5
by: Patrick.O.Ige | last post by:
Whats the best way to pass Data with hidden fields in asp.net. I want to capture a LOGON_USER(from an intranet using Windows Authentication)and then send the data to a table in the Database. Any...
0
by: Patrick Olurotimi Ige | last post by:
Whats the best way to pass Data with hidden fields in asp.net. I want to capture a LOGON_USER(from an intranet using Windows Authentication)and then send the data to a table in the Database. Any...
5
by: Roshawn Dawson | last post by:
Hi, Are hidden fields passed in the querystring when a form is posted back? If they are, must the hidden fields be server controls in order to access them from .net code? Thanks, Roshawn
0
by: BcNexus | last post by:
Hello all, The search function of this forum isn't working although I found a similar question on the forum using Google, but the replies don't help me. So, forgive me please if this has been...
1
by: jamestpaul | last post by:
I'm having some difficulty with Safari users and hidden fields in my .NET 2 asp application. There is a hidden field that gets loaded with the contents of a div in my form. When the user submits...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.