Skip to:
Content
Pages
Categories
Search
Top
Bottom

Jquery Code for the Text Dissappear in the Whats New Textarea

  • @lockamiz23

    Member

    On buddypress.org, 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?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • @naijaping

    Participant

    `hi, follow this example and you should ok

    `

    @naijaping

    Participant

    or just follow this tutorial: http://goo.gl/Wt84G

    @virtuali

    Member

    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.

    @djpaul

    Keymaster

    Forget all that. Use the HTML5 placeholder attribute.

    http://diveintohtml5.org/forms.html#placeholder

    @hnla

    Participant

    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 !

    @djpaul

    Keymaster

    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.

    @abysshorror

    Member

    @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