Quantcast

placeHolder for simpleTextArea

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

placeHolder for simpleTextArea

denov
all,

i understand placeHolder doesn't work and is a filled bug but does
anybody have work-around they'd like to share?


thanks,
deno
________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: placeHolder for simpleTextArea

Karl Tiedt

Text areas in html don't support them if I remember right... so it's not exactly a bug that we don't support them.


________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: placeHolder for simpleTextArea

Kenneth G. Franqueiro
Textareas do support placeholder, as evidenced by this fiddle when run
in any browser that natively supports placeholders (see
http://caniuse.com/#search=placeholder )

http://jsfiddle.net/73JVn/

If you inspect, you'll notice that Dijit simply applied that property as
an attribute of the textarea in this case.  If you're concerned about
browsers that don't support placeholder OOTB though, then you'd have
some more work ahead of you.

IIRC this was attempted for Dijit, but ran into problems.  The way Dijit
pulled off cross-browser placeholders for textboxes was to nest the
textbox in another node.  Currently the Textarea widgets don't do this,
and IIRC when attempts were made to nest, there were problems regarding
ensuring backwards-compatible behavior of height-related properties.

--Ken

On 11/20/2012 9:54 PM, Karl Tiedt wrote:

> Text areas in html don't support them if I remember right... so it's not
> exactly a bug that we don't support them.
>
>
>
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: placeHolder for simpleTextArea

Kitson Kelly
Yes, I took a look at it the other day: http://bugs.dojotoolkit.org/ticket/11145.  You can see a couple attempts by Bill to fix it, but it isn't as straight forward as it looks (while maintaining the cross-browser capability required for Dijit in 1.X).


On 21 November 2012 03:06, Kenneth G. Franqueiro <[hidden email]> wrote:
Textareas do support placeholder, as evidenced by this fiddle when run
in any browser that natively supports placeholders (see
http://caniuse.com/#search=placeholder )

http://jsfiddle.net/73JVn/

If you inspect, you'll notice that Dijit simply applied that property as
an attribute of the textarea in this case.  If you're concerned about
browsers that don't support placeholder OOTB though, then you'd have
some more work ahead of you.

IIRC this was attempted for Dijit, but ran into problems.  The way Dijit
pulled off cross-browser placeholders for textboxes was to nest the
textbox in another node.  Currently the Textarea widgets don't do this,
and IIRC when attempts were made to nest, there were problems regarding
ensuring backwards-compatible behavior of height-related properties.

--Ken

On 11/20/2012 9:54 PM, Karl Tiedt wrote:
> Text areas in html don't support them if I remember right... so it's not
> exactly a bug that we don't support them.
>
>
>
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: placeHolder for simpleTextArea

denov
is there any reason why i couldn't get away with hooking into blur and focus?  blur would add text and style.  focus would remove text and style if style was present.

- deno

On 11/20/2012 9:18 PM, Kitson Kelly wrote:
Yes, I took a look at it the other day: http://bugs.dojotoolkit.org/ticket/11145.  You can see a couple attempts by Bill to fix it, but it isn't as straight forward as it looks (while maintaining the cross-browser capability required for Dijit in 1.X).


On 21 November 2012 03:06, Kenneth G. Franqueiro <[hidden email]> wrote:
Textareas do support placeholder, as evidenced by this fiddle when run
in any browser that natively supports placeholders (see
http://caniuse.com/#search=placeholder )

http://jsfiddle.net/73JVn/

If you inspect, you'll notice that Dijit simply applied that property as
an attribute of the textarea in this case.  If you're concerned about
browsers that don't support placeholder OOTB though, then you'd have
some more work ahead of you.

IIRC this was attempted for Dijit, but ran into problems.  The way Dijit
pulled off cross-browser placeholders for textboxes was to nest the
textbox in another node.  Currently the Textarea widgets don't do this,
and IIRC when attempts were made to nest, there were problems regarding
ensuring backwards-compatible behavior of height-related properties.

--Ken

On 11/20/2012 9:54 PM, Karl Tiedt wrote:
> Text areas in html don't support them if I remember right... so it's not
> exactly a bug that we don't support them.
>
>
>
> ________________________________________________________
> Dojo Toolkit: http://dojotoolkit.org/
> Tutorials: http://dojotoolkit.org/documentation/
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
>
> [hidden email]
> To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest


________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: placeHolder for simpleTextArea

thierry Chaudy
This post has NOT been accepted by the mailing list yet.
In reply to this post by denov
Why not simply set a default value and remove it on focus (and re set it on blur when empty) ?

So something like that:

                var simpleTextarea = new SimpleTextarea({
                    value: this.resources.INSERT_YOUR_MESSAGE_HERE,
                    onFocus: lang.hitch(this, function() {
                        //on focus, remove the watermark
                        if (simpleTextarea .get("value") == this.resources.INSERT_YOUR_MESSAGE_HERE) {
                            simpleTextarea .set("value", "");
                        }
                    }),
                    onBlur: lang.hitch(this, function() {
                        // on blur, if empty, re set the watermark
                        if (simpleTextarea .get("value") == "") {
                            simpleTextarea .set("value", this.resources.INSERT_YOUR_MESSAGE_HERE);
                        }
                    })
                }, simpleTextarea Container);

It's simple and can be a work around...
Loading...