Re: [css-d] maxlength attribute in css
> Hi, > > I have been googling without success around for a way to set maxlength > for form inputs in CSS -- is this possible as far as anyone knows? > > If not, and if I have to use Javascript to achieve this task, can > someone point me to a Javascript discussion list that is equivalent to > this CSS list? What is wrong with ? A maximum length is not a visual attribute, it is a data restriction, and therefore not the job of css. With JavaScript you"d need to read out the value length of the element on every keyup and stop at a certain length. -- Chris Heilmann Blog: http://www.wait-till-i.com Writing: http://icant.co.uk/ Binaries: http://www.onlinetools.org/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
RE: [css-d] maxlength attribute in css
What they *might* be asking is -> A designer wants to format text boxes to be the same horizontal size even though their inputs are set at different maximums. For example, a phone number field takes 11 digits, give or take, and a name field takes 30 let's say, but the designer might want them both to be the same visual size to make the form prettier. This is a complete guess, so ignore it if it's completely irrelevant. :) -Original Message- > I have been googling without success around for a way to set maxlength > for form inputs in CSS -- is this possible as far as anyone knows? > > If not, and if I have to use Javascript to achieve this task, can > someone point me to a Javascript discussion list that is equivalent to > this CSS list? What is wrong with ? A maximum length is not a visual attribute, it is a data restriction, and therefore not the job of css. With JavaScript you"d need to read out the value length of the element on every keyup and stop at a certain length. __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] maxlength attribute in css
Christian Heilmann wrote: What is wrong with ? A maximum length is not a visual attribute, it is a data restriction, and therefore not the job of css. there's nothing "wrong" with it, but it won't validate xhtml strict... sorry, i don't have a solution either. __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] maxlength attribute in css
That makes perfect sense. Thanks for helping me realize that I really only want to eliminate *presentation* attributes from my xhtml template, not *all* attributes. - Chaz On 9/21/05, Christian Heilmann <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have been googling without success around for a way to set maxlength > > for form inputs in CSS -- is this possible as far as anyone knows? > > > > If not, and if I have to use Javascript to achieve this task, can > > someone point me to a Javascript discussion list that is equivalent to > > this CSS list? > > What is wrong with ? A maximum length is not > a visual attribute, it is a data restriction, and therefore not the > job of css. With JavaScript you"d need to read out the value length of > the element on every keyup and stop at a certain length. > > -- > Chris Heilmann > Blog: http://www.wait-till-i.com > Writing: http://icant.co.uk/ > Binaries: http://www.onlinetools.org/ > __ > css-discuss [EMAIL PROTECTED] > http://www.css-discuss.org/mailman/listinfo/css-d > List wiki/FAQ -- http://css-discuss.incutio.com/ > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ > __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] maxlength attribute in css
Brian Cummiskey wrote: there's nothing "wrong" with it, but it won't validate xhtml strict... Yes, it will, if you spell it correctly (maxlength). XHTML 1.1: http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_extformsmodule XHTML 1.0 (defined by HTML 4.01): http://www.w3.org/TR/html401/interact/forms.html#h-17.4 If it doesn't validate, that's a bug in the validator. Sebastian Redl __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/