HighDots Forums  

input type=text maxlength=5 -> can this go into a css?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss input type=text maxlength=5 -> can this go into a css? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gianni Rondinini
 
Posts: n/a

Default input type=text maxlength=5 -> can this go into a css? - 07-26-2006 , 05:11 AM






hi all.

i've almost finished moving all the tags from html to my css.

however, i can't find a way (if there's one) to move the property
maxlength of an <input type=text ...> tag to the css in which i define
a class for my input's (colors, width, font and so on).

i'd appreciate if anybody could tell me if i'm looking for something
that doesn't exist or if i just cannot find it.

thank you in advance.
--
Gianni Rondinini (31, tanti, RA)
Nikon user - Bmw driver
http://bugbarbeq.deviantart.com

Reply With Quote
  #2  
Old   
Markus Ernst
 
Posts: n/a

Default Re: input type=text maxlength=5 -> can this go into a css? - 07-26-2006 , 05:22 AM






Gianni Rondinini schrieb:
Quote:
hi all.

i've almost finished moving all the tags from html to my css.

however, i can't find a way (if there's one) to move the property
maxlength of an <input type=text ...> tag to the css in which i define
a class for my input's (colors, width, font and so on).

i'd appreciate if anybody could tell me if i'm looking for something
that doesn't exist or if i just cannot find it.
You are looking for something that is not even a good idea :-) CSS is to
be used for everything that concerns presentation. CSS can be dropped or
overridden, in some cases (such as text-only browsers or screen readers)
it has no relevance at all.

Maxlength is not presentation, but functionality, so this must remain in
the HTML code, such as the form action or the form method, or the input
type.

--
Markus


Reply With Quote
  #3  
Old   
Christian Kirsch
 
Posts: n/a

Default Re: input type=text maxlength=5 -> can this go into a css? - 07-26-2006 , 07:38 AM



Gianni Rondinini schrieb:
Quote:
hi all.

i've almost finished moving all the tags from html to my css.

however, i can't find a way (if there's one) to move the property
maxlength of an <input type=text ...> tag to the css in which i define
a class for my input's (colors, width, font and so on).

You can't. Maxlength is an HTML attribute. It has nothing to do with
representation (aka CSS), because it effectively limits the maximum
number of characters one can enter into a text field.



Reply With Quote
  #4  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: input type=text maxlength=5 -> can this go into a css? - 07-26-2006 , 07:52 AM



On Wed, 26 Jul 2006, Christian Kirsch wrote:

Quote:
Maxlength is an HTML attribute.
Agreed. It's the "size" attribute which is relevant to presentation.

Quote:
[... maxlength] effectively limits the maximum number of characters
one can enter into a text field.
"effectively"? Yes, it tells a conforming client to limit the length
of input; but it has no effect on those who submit malicious input.

Far too many people have written server-side scripts which relied on
this kind of constraint in their own form, but which turned into a
security exposure when someone tweaked the HTML (or scripted their own
version of the form submission).

One should never forget the need to validate every substantive aspect
of a form submission, *at the server*, never placing any trust on
constraints which were attempted to be imposed on the client by the
HTML, javascript, etc.

Nothing personal, but I see the consequences of a fairly steady stream
of these kinds of system design error, so I do think it bears
repeating.


Reply With Quote
  #5  
Old   
Christian Kirsch
 
Posts: n/a

Default Re: input type=text maxlength=5 -> can this go into a css? - 07-26-2006 , 08:06 AM



Alan J. Flavell schrieb:
Quote:
On Wed, 26 Jul 2006, Christian Kirsch wrote:

Maxlength is an HTML attribute.

Agreed. It's the "size" attribute which is relevant to presentation.

[... maxlength] effectively limits the maximum number of characters
one can enter into a text field.

"effectively"? Yes, it tells a conforming client to limit the length
of input; but it has no effect on those who submit malicious input.

or may be efficiently? English is not my native language, so please
forgive me for having been carried away by adjectivities.



Reply With Quote
  #6  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: input type=text maxlength=5 -> can this go into a css? - 07-26-2006 , 08:41 AM



On Wed, 26 Jul 2006, Christian Kirsch wrote:

Quote:
Alan J. Flavell schrieb:
"effectively"? Yes, it tells a conforming client to limit the length
of input; but it has no effect on those who submit malicious input.

or may be efficiently? English is not my native language,
klar - aber ueber Sprachkentnisse wollte ich wirklich nicht meckern,
ehrlich.

Quote:
so please forgive me for having been carried away by adjectivities.
Maybe we have a problem with "effective/effektiv" in the sense of
"wirksam", as opposed to the sense of "wird schon gehen".

Native English speakers often enough do not make the distinction,
either - and it was that point which prompted my followup: that
maxlength is only effective/wirksam if the client honours it. It's by
no means a complete way of limiting input to a server-side script.

(For non-German-speakers: I'm only trying to assure Christian that I
hadn't intended any criticism of his command of English. And given
him a chance to laugh at my German ;-).

btw: "efficient" would not be the right word in the above context.


Reply With Quote
  #7  
Old   
Gianni Rondinini
 
Posts: n/a

Default Re: input type=text maxlength=5 -> can this go into a css? - 07-26-2006 , 08:49 AM



On Wed, 26 Jul 2006 13:52:21 +0100, "Alan J. Flavell"
<flavell (AT) physics (DOT) gla.ac.uk> wrote:

Quote:
"effectively"? Yes, it tells a conforming client to limit the length
of input; but it has no effect on those who submit malicious input.
you are perfectly right. i didn't write this, but this page is going
to be used only by internal trusted users and security isn't an issue
with this very exact thing.

however, thanks for pointing this out: i'll keep it in mind.

regards,
--
Gianni Rondinini (31, tanti, RA)
Nikon user - Bmw driver
http://bugbarbeq.deviantart.com


Reply With Quote
  #8  
Old   
Gianni Rondinini
 
Posts: n/a

Default Re: input type=text maxlength=5 -> can this go into a css? - 07-26-2006 , 09:16 AM



On Wed, 26 Jul 2006 12:22:52 +0200, Markus Ernst
<derernst@NO#SP#AMgmx.ch> wrote:

Quote:
Maxlength is not presentation, but functionality, so this must remain in
the HTML code, such as the form action or the form method, or the input
type.
got it.
thanks.
--
Gianni Rondinini (31, tanti, RA)
Nikon user - Bmw driver
http://bugbarbeq.deviantart.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.