Skip to:
Content
Pages
Categories
Search
Top
Bottom

Help for What’s New Textareas Autofill Text


  • Virtuali
    Participant

    @gunju2221

    I need a little help, maybe this is too complicated for a rookie, probably a question for the buddypress.org programmers.

    I am copying the ‘autofill textareas with text, than disappear when clicked, (like buddypress.org whats new textarea) although I am missing some Textarea IDs, and wondering if bp.org uses the same “id=”whats-new” for groups, and profile posting, because if you use the `onFocus=”this.value=”; return false;` approach, the Text on the Textareas stays the same for groups, illuminating the “Whats New in %group% ….”

    On bp.org, it’s different for groups, so what is the other textarea id value that you would add to:

    ``

    To make this correct?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Better done with a little jQuery snippet than packing out the markup with scripting bloat, you can fairly easily run a focus /blur event handler checking for a value of ‘value’ and flip flopping the removal or replacement of any string in .value, the element then requires a class token of some description for jQuery to hook onto and whatever string for the value of an input or textarea you choose ; only problem with BP is the use of Ajax as the page does not refresh after submission and you have to wait for a page refresh before the placeholder text is presented again.

    Actually the use of the placeholder attribute introduced with html5 is the better way to proceed as it’s designed to avoid any possibility of that text getting unwittingly submitted along with genuine text, most Modern browsers support this attribute however BP appears to be messing it up somehow? not really sure what BP is doing but an examination of the two main JS files is probably required.

    P.S always use lowercase JS attributes rather than camelCasing them as that strictly speaking fails validation


    Virtuali
    Participant

    @gunju2221

    jQuery is fine with me, probably better, weather to hook the js code into the file, or put it in an external file and call it. Problem is, I am still stuck on the textarea ID values. It still remains the same input text, only set once. Unless I put to more js in the file with different IDs, same js

    Maybe something in the range of:

    `$(selector).defaultValue(‘Username’);
    `

    or

    `
    $(‘#myInput’).defaultValue();`

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help for What’s New Textareas Autofill Text’ is closed to new replies.
Skip to toolbar