Re: [whatwg] [WF2] Clear On Focus attribute
On Wed, 23 May 2007 02:31:38 +0200, Charles Iliya Krempeaux [EMAIL PROTECTED] wrote: You need a label for the field... but don't want to put one beside it. So the label goes inside the field... until you click on it. (At which point the label disappears.) The field's value shouldn't be abused to achieve this effect because the label is not a value. Stylesheets should be used to get a semantically appropriate piece of information, such as the field's title, to display in the box when the field is empty and has no focus. -- Alexey Feldgendler [EMAIL PROTECTED] [ICQ: 115226275] http://feldgendler.livejournal.com
Re: [whatwg] [WF2] Clear On Focus attribute
Hello Alexey, On 5/23/07, Alexey Feldgendler [EMAIL PROTECTED] wrote: On Wed, 23 May 2007 02:31:38 +0200, Charles Iliya Krempeaux [EMAIL PROTECTED] wrote: You need a label for the field... but don't want to put one beside it. So the label goes inside the field... until you click on it. (At which point the label disappears.) The field's value shouldn't be abused to achieve this effect because the label is not a value. Stylesheets should be used to get a semantically appropriate piece of information, such as the field's title, to display in the box when the field is empty and has no focus. It's true that web developers probably should not be doing this. (Since it messes up semantics.) But they are. So... perhaps we can come up with a way for them to get this effect, while preserving semantics. Maybe a new attribute? innerlabel maybe... or something like that. So, maybe something like input type=search innerlabel=search in vancouver... (And this would have the effect described in the original post. I.e., a text input box with search in vancouver... inside of it. When the use clicks in the text input box, that text disappears.) (Although maybe a new innerlabel attribute is the wrong way to do this. Perhaps a combination of the label element and the input element can be used for this... BUT where CSS can be extended somehow to put the text of the label into the text input box.) See ya -- Charles Iliya Krempeaux, B.Sc. charles @ reptile.ca supercanadian @ gmail.com developer weblog: http://ChangeLog.ca/
Re: [whatwg] [WF2] Clear On Focus attribute
On Wed, 23 May 2007 19:02:26 +0200, Charles Iliya Krempeaux [EMAIL PROTECTED] wrote: The field's value shouldn't be abused to achieve this effect because the label is not a value. Stylesheets should be used to get a semantically appropriate piece of information, such as the field's title, to display in the box when the field is empty and has no focus. It's true that web developers probably should not be doing this. (Since it messes up semantics.) But they are. So... perhaps we can come up with a way for them to get this effect, while preserving semantics. Maybe a new attribute? innerlabel maybe... or something like that. So, maybe something like input type=search innerlabel=search in vancouver... Innerlabel smells a bit of cellspacing and bgcolor. The fact that the label is inner shouldn't deserve a separate way of expression in markup. My point is that it's CSS, not HTML, that should be extended to make it possible to put the label inside the input. Something along the lines of: input[value=]:not(:focus) { content: attr(title) } (Currently that would completely replace the input field with static text, without any chance of focusing the control. Probably there should be something better than the content property. CSS3 is definitely going to offer something here.) -- Alexey Feldgendler [EMAIL PROTECTED] [ICQ: 115226275] http://feldgendler.livejournal.com
Re: [whatwg] [WF2] Clear On Focus attribute
Hello, On 5/23/07, Maciej Stachowiak [EMAIL PROTECTED] wrote: On May 23, 2007, at 10:02 AM, Charles Iliya Krempeaux wrote: So... perhaps we can come up with a way for them to get this effect, while preserving semantics. Maybe a new attribute? innerlabel maybe... or something like that. So, maybe something like input type=search innerlabel=search in vancouver... (And this would have the effect described in the original post. I.e., a text input box with search in vancouver... inside of it. When the use clicks in the text input box, that text disappears.) Did you see the proposal to use WebKit's placeholder attribute for this purpose? It already works the way you suggest. Guess that's another reason to have an attribute like that in HTML5 :-) -- Charles Iliya Krempeaux, B.Sc. charles @ reptile.ca supercanadian @ gmail.com developer weblog: http://ChangeLog.ca/
Re: [whatwg] [WF2] Clear On Focus attribute
Hello, On 5/22/07, Matthew Paul Thomas [EMAIL PROTECTED] wrote: On May 22, 2007, at 3:35 AM, Stijn Peeters wrote: It is becoming increasingly common to have an input field clear its value when it is first focused. Though in a lot of cases this is actually wrong usage of the value= attribute for something which should actually be done with label (such as a search box filled with Enter search query here that becomes empty when you first click it), Indeed. it is possible to come up with legitimate use cases; the first thing that comes to mind are input fields with placeholder or default values that may need to be changed. This goes well together with WF2's new abilities for prefilling forms. It makes sense to clear these values when the field is focused, as the user will probably want to insert a new value rather than edit the value that is currently in it. ... I don't understand. What use is a default value if you can't edit it? Why not make the field empty to begin with? It's a Usability issue mixed with a Graphical design / aesthetics issue., You need a label for the field... but don't want to put one beside it. So the label goes inside the field... until you click on it. (At which point the label disappears.) See ya -- Charles Iliya Krempeaux, B.Sc. charles @ reptile.ca supercanadian @ gmail.com developer weblog: http://ChangeLog.ca/
[whatwg] [WF2] Clear On Focus attribute
It is becoming increasingly common to have an input field clear its value when it is first focused. Though in a lot of cases this is actually wrong usage of the value= attribute for something which should actually be done with label (such as a search box filled with Enter search query here that becomes empty when you first click it), it is possible to come up with legitimate use cases; the first thing that comes to mind are input fields with placeholder or default values that may need to be changed. This goes well together with WF2's new abilities for prefilling forms. It makes sense to clear these values when the field is focused, as the user will probably want to insert a new value rather than edit the value that is currently in it. Currently this is mostly done through javascript, which is not necessarily a bad thing, but seeing that attributes such as autofocus= have also found their way into the spec, I suppose this is also inside the scope of Web Forms 2 or HTML5. As for the attribute name, clearonfocus= with clearonfocus as the only possible value (indicating the input field or textarea should be cleared upon focusing it) would probably be most suitable. -- Regards, Stijn Peeters
Re: [whatwg] [WF2] Clear On Focus attribute
On Mon, 21 May 2007 17:35:27 +0200, Stijn Peeters [EMAIL PROTECTED] wrote: It is becoming increasingly common to have an input field clear its value when it is first focused. Though in a lot of cases this is actually wrong usage of the value= attribute for something which should actually be done with label (such as a search box filled with Enter search query here that becomes empty when you first click it), it is possible to come up with legitimate use cases; the first thing that comes to mind are input fields with placeholder or default values that may need to be changed. This goes well together with WF2's new abilities for prefilling forms. It makes sense to clear these values when the field is focused, as the user will probably want to insert a new value rather than edit the value that is currently in it. Currently this is mostly done through javascript, which is not necessarily a bad thing, but seeing that attributes such as autofocus= have also found their way into the spec, I suppose this is also inside the scope of Web Forms 2 or HTML5. As for the attribute name, clearonfocus= with clearonfocus as the only possible value (indicating the input field or textarea should be cleared upon focusing it) would probably be most suitable. WebKit implements a placeholder= attribute which seems more suitable for this purpose. -- Anne van Kesteren http://annevankesteren.nl/ http://www.opera.com/