RSS Dave on Twitter

Improving #SharePoint Forms – Hints

Posted: February 22nd, 2010 | Author: davecavins | Filed under: SharePoint Design | Tags: , , | 3 Comments »

When users are asked to enter information in a form sometimes it helps to give them a hint regarding what types of information should be entered.  Out of the box you can enter a description of each field that will be displayed.  If you want something more dynamic here is how to do it. 

  • Add jQuery to the page using the method described in this post
  • Download the jQuery Hint Box plugin and link it to the page. 
  • Call the script and set the options for the position and html content of the hint. Here is an example:
<script type="text/javascript">
$("input[title='Author']").inputHintBox({
	className:'simple_box',
	html:'Who is the author of this quote?',
	incrementLeft:-25,
	incrementTop:-15
	});
</script>

The above script simply selects  the field using its  title attribute then sets the css class for the element, its contents and position.

Here is the CSS I used for my example.

.simple_box{
	border:1px solid gray; background:url('/_layouts/images/toolgrad.gif');
	font-size:xx-small; color:#444; padding:7px;
}

Here it is in action.

hints

Bookmark and Share

Related posts:

  1. Improving #SharePoint Forms – Character Count
  2. Hiding the user presence icon
  3. Improving #SharePoint Forms – Watermarks
Share on Google Buzz

3 Comments on “Improving #SharePoint Forms – Hints”

  1. 1 Barto Molina said at 3:18 pm on March 7th, 2010:

    Good stuff Dave! I’ve got one questiong, do you know if it would be possible to include HTML in the field description, for example a link to an external page?

  2. 2 davecavins said at 7:45 am on March 10th, 2010:

    @Barto – I would have to look at the features of the jQuery plugin but I am pretty sure it is possible. Also check out this solution http://sharepointjavascript.wordpress.com/2009/10/29/add-html-mouseover-tooltip/

  3. 3 Improving #SharePoint Forms – Watermarks | Dave Cavins said at 11:59 am on May 3rd, 2010:

    [...] Improving #SharePoint Forms – Hints [...]


Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes