Stump the Panel » jQuery for Everyone

When mouse over field in form, how change text displayed

(6 posts)
  • Started 2 days ago by RUANAPE
  • Latest reply from AutoSponge
  1. RUANAPE
    Member

    I am using MOSS 2007, and I am trying to have it so when a user puts the cursor over a field in a form they need to fill out, text will show explaining what is needed in that particular field. Ultimately, I would love to bind each field to a coresponding description located in a 'field help' list. The list has only 2 columns; a name column and a description column. I only have access to SP designer 2007. Hopefully I gave enough info for someone to help me....I'm stumped.

    Posted 2 days ago #
  2. Is this in the DispForm.aspx or in a Infopath form?

    Posted 1 day ago #
  3. RUANAPE
    Member

    Actually, i am trying to do this in the NewForm.aspx

    Posted 1 day ago #
  4. You can do this with some JavaScript. The problem with a central list of help text is that fields could have the same name but mean something different on different lists. You would need to be most specific.

    Besides, fields already have description text (although I hate where it appears), this text is more accessible because it displays inline with the form field.

    A simpler approach that will degrade nicely and work without additional calls is to just wrap the field description text into a tooltip and appears when you hover, click, focus, etc.

    What do you think of that approach?

    Posted 1 day ago #
  5. RUANAPE
    Member

    I like it, sounds like the easiest solution I have heard of yet. How do you do it?

    Posted 1 day ago #
  6. Ruanape,

    First, we have to grab the text from the description field. Using jQuery, I do something like this to see what I'm working with:

    $("td.ms-formbody:visible").each(function(i,e){
        var t = $(e).text().replace(/\s+/g," ");
        console.log(t);
    });

    Then you have to pick or develop a tip style. There are several tooltip plugins and scripts to poll for examples.

    Then add the content you collected to the row and remove the content from the default location. Getting the data to look nice may take some practice.

    If jQuery fails to load, the descriptions will remain in the default location.

    Posted 1 day ago #

RSS feed for this topic

Reply

You must log in to post.