SharePoint 2007, Modify Tooltip Text in SharePoint forms: EditForm.aspx and NewForm.aspx
I have a list in SharePoint that was created awhile back. The names assigned to some of the columns in the list are no longer relevant. Due to existing code, the column names cannot be modified to reflect the preferred names. I was able to change the lables assiciated with these fields within forms NewForm.aspx and EditForm.aspx. All looks and works just fine except for when the curser lingers in one of these fields, the tooltip that appears contains the underlining (original...no longer relevant) column names. This is confusing to the user since the name within the lable and the tooltip are different. I would like a way to either disable the tooltip from displaying or to modify it to display a custom value. Below is the code from behind the form as it appears in Sharepoint Designer. I would appreciate some input on this. <SharePoint:FormField runat="server" id="ff11{$Pos}" ControlMode="Edit" FieldName="My_x0020_Field_x0020_Name" __designer:bind="{ddwrt:DataBind('u',concat('ff11',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@My_x0020_Field_x0020_Name')}"/> <SharePoint:FieldDescription runat="server" id="ff11description{$Pos}" FieldName="My_x0020_Field_x0020_Name" ControlMode="Edit"/>
August 11th, 2010 9:48pm

Hello VBCoder60, I looked into this for you and based on the following document there seems to be no property we can use to disable the tooltip, aka title attribute in the DOM. There are a ton of ways to work on this though. At the end is the easiest route. http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.formfield_properties.aspx You could use SharePoint Object model code to change the name of the column instead of deleting it and recreating it. That might be a better question for the developer forums though. You could use something like SharePoint Manager to cheat but I would be very cautious with that tool. It's very powerful and hurt your farm. Check the codeplex for any questions regarding support boundaries around that tool. The next option is to use SPD and convert the <SharePoint:FormField> control to an asp.net textbox. If you highlight the form field control in SharePoint Designer 2007 you will see a chevron, greater than/less than sign, which you can click. Once of the options in the flyout menu is textbox. SPD will wire up the asp.net textbox for you so you will only need to add a ToolTip attribute/property to it. Here is an example of the finished product: <asp:TextBox runat="server" ToolTip="My custom tooltip" id="ff1{$Pos}" text="{@Title}" __designer:bind="{ddwrt:DataBind('i',concat('ff1',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}" /> If you look at my example I added an attribute to the asp:TextBox element called ToolTip. Here is the documentation for that. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.tooltip.aspx As Jeff Holliday suggested, you can use jQuery. I had some issues coming up with a decent looping system to take the text label on the left hand side of the form and insert it into the title attribute of the input/whatever else element might be present on your form. This sample script will just null out the title attribute for all input elements. I have not done an extensive testing to see if has any adverse effects but it gets rid of the tooltip on a title column and any other single line of text column. You might need to do something similar to other HTML elements depending on your form. <script type="text/javascript" src="../../Documents/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $("tr td[class='ms-formbody'] span input[title!='']").attr('title', ''); }); </script> Finally and easiest of all, if you go into your list settings and rename the column there the out of the box form field controls will display that text for a tooltip. This is a typical customization. Usually, if you're creating columns through the UI most will create a column without using spaces in the name and then later go in and edit the column to give it a friendlier name. The internal name stays the same but the display name is updated. You will still need to adjust the left hand text by hand in SPD or regenerate the custom list form. Regards, Dalibor K Microsoft Online Community Support
Free Windows Admin Tool Kit Click here and download it now
September 15th, 2010 1:45am

Hi Dalibor, I could able to suppress the tooltip for the single line textbox field BUT could not able to suppress the tooltip for the choice(radio button) type field. Please suggest me something. Thanks in advance, HK
February 21st, 2011 7:15pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics