Max number of charactors allowed?
-
Tuesday, May 15, 2012 8:30 PM
If I am only using the column for say a phone number is it beneficial to set the "Max number of charactors allowed:" to the appropriate limit.
I recall in a basic SQL course I took it was good practice to always limit the input to what is expected, not sure if it matters in SharePoint?
Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.
All Replies
-
Tuesday, May 15, 2012 8:44 PM
I imagine that it's not going to make a difference from a system perspective (someone can correct me if I'm wrong there). However, just to help you validate the input, you might as well limit it to what's valid.- cawood
- Marked As Answer by Stunpals Wednesday, May 16, 2012 3:00 PM
-
Tuesday, May 15, 2012 10:41 PM
Telephone numbers, addresses, and currencies can vary in format according to users location and even preference. If you limit the input to 10 characters for a North American phone number (5551234567), the user may end up adding input dashes or a "1" prefix (1-555-123-4567) and then get frustrated when the form doesn't validate or they can't input the value they wanted to.
Since the standard SP single line text input is mapped to a 255 character SQL field, limiting the max length on form inputs themselves will not affect anything except your business logic. Each database row (can also be split over 2 rows depending on the number of columns in your list) has their column types (e.g. nvarChar(255)) predefined according to their type already, out of the box.You will probably spare some grey hairs by using a relaxed policy in terms of maximum length - you will be much more likely to bog down SharePoint by sheer number of records and other symptoms of incorrectly archtitected list structure.
Keith Tuomi | Twitter: @itgroove_keith | Blog: http://yalla.itgroove.net
Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you.- Edited by Keith Tuomi Tuesday, May 15, 2012 10:42 PM
- Marked As Answer by Stunpals Wednesday, May 16, 2012 3:00 PM
-
Wednesday, May 16, 2012 2:59 PM
Thanks for the replies, definitely clarifies things for me.
As for the format of the columns, I have come across a jQuery solution that provides input-masking, which is configurable to your data. It works great and I have implemented it for several of my columns. Took a bit of trial, (I haven't done much code manipulation) but works as expected. A follow up posting by the same author demonstrated a email validation jQuery as well.
Input-Masking - http://spdeveloper.net/2009/10/input-masking-in-sharepoint-forms/comment-page-1/
Validation - http://spdeveloper.net/tag/jquery/
Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.
blog
twitter
