So I found this cool jQuery plugin that does watermarks for form inputs. Using watermarks is a good way to help make SharePoint forms easier to use. To test the plugin I started with the new item form from same test list I used in my previous posts.
- jQuery Library referenced in the page
- CEWP on the page
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:
html:'Who is the author of this quote?',
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.
border:1px solid gray; background:url('/_layouts/images/toolgrad.gif');
font-size:xx-small; color:#444; padding:7px;
Here it is in action.
For the sake of demonstration I made a list called quotes. Each quote has a title, body and author field, as a requirement the body field should not have more than 200 characters. So to let users know when they are getting close to the character limit we will setup a character count script.
For this solution I will use this jQuery script from CSS Globe.
The default form
Over the next few weeks I will be writing a series of posts on how to improve the out of the box SharePoint forms by using simple CSS and jQuery solutions. These solutions will help improve usability as well as enhance the look and feel. Look for the first post later this week.
As a point of reference this is what we will be starting with.
Standard SharePoint Form
Stay tuned for more soon.