Max length

Topics: Customizing Orchard, General
May 13, 2013 at 9:45 AM
Hi there

I have created a custom field in which a user can type in a short description about a property.
I have set this as a txt field but would like to set this with a max length. Does anyone know how to do this please?

Currently there is no limit and if too much text is entered the text affects the layout of all my other fields.

Any help appreciated ...... many thanks,
Kirsty
Coordinator
May 13, 2013 at 5:39 PM
You would need a custom module for that. But a solution to your issue might be to use a css overflow property to limit the length which is displayed. I assume you have an issue in summaries and that a detailed page could show the whole content.
May 14, 2013 at 11:31 AM

Hi there, that is exactly what I needed. I have got this working by using CSS as you suggested with overflow and word-wrap! Thanks, Kirsty

Aug 13, 2013 at 3:33 PM
A bit late to this thread, but it's likely that others will come against this problem, so...

If you want to restrict the max input (rather than output) length, then when constructing your content type, add an "input field", not a text field. (Input fields have a maximum length property).