Skip to:

Jquery Code for the Text Dissappear in the Whats New Textarea

  • lockamiz23


    On, I want to copy the “whats-new” textarea to say “Write Something” in the textbox, than disappear when clicked, but how???

    I know there is already a jquery class for that on the search textbox for the groups, members, and forums, but that is it?


Viewing 7 replies - 1 through 7 (of 7 total)
  • `hi, follow this example and you should ok


    or just follow this tutorial:

    This is what I use on my site. Insert this in your post-form.php:

    `$(‘textarea’).each(function() {
    $(this).data(‘default’, this.value);
    }).focusin(function() {
    if ( this.value == $(this).data(‘default’) ) {
    this.value = ”;
    }).focusout(function() {
    if ( this.value == ” ) {
    this.value = $(this).data(‘default’);

    The above solution will work as well, but the text won’t re-appear if the user clicks off the textarea.

    Forget all that. Use the HTML5 placeholder attribute.

    Forget that ;) html5 an unratified proposal don’t forget things may change, behavior is the safe way of handling this, and anyway you would need to switch to a plain Doc Type sans formal identifier.

    You avant guard coders !

    I think that’s mostly rubbish in this day and age. Every decent browser supports placeholder, and a lot of other HTML5 features. HTML’s moved away from a “what’s in this version of the specs” to a “what does your browser support” model.



    @virtuali Exactly where in post-form.php should I put that code ?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Jquery Code for the Text Dissappear in the Whats New Textarea’ is closed to new replies.
Skip to toolbar