- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:34 AM
HI All,
I'm just wondering if there is a way to limit the amount of space a string field will occupy on my form? I have a description field which permits 4000 characters, i don't want to reduce the number of characters but i want to limit the size the actual field is before it starts scrolling.
The image below shows a fully populated description field, is there a way to make it occupy half the space it currently does?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 02:08 AM
Hi David
Yes it is working but i found that it depends on the Max length defined in the dictionary.
When i tried for the short_description which have max_length 160 , the style setting was working fine. When I applied the same settings for the description field which has length of 4000, style setting was not working.
-Harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 02:13 AM
Hi Harsh,
That's what i'm seeing as well. When i open the form the description field starts off at normal size and then recalculates to the larger size. There's no note of a client script doing this is the javascript log so i assume it's background functionality that we don't have access to.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:48 AM
Use this code in a onLoad client script:
function onLoad() {
var fieldName = 'description';
var el = g_form.getControl(fieldName);
el.style.height = '200px';
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 01:56 AM
Use this code in a onLoad client script:
function onLoad() {
var fieldName = 'description';
var el = g_form.getControl(fieldName);
el.style.height = '200px';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 02:15 AM
Thanks Gowrisankar, that script works when i try it on the short description but it does nothing on the max-length description field. It looks like there's some background functionality working on this field that overrides any attempt to modify field styling.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 02:20 AM
Hi Dave,
Can you deactivate the field styles and try again?
It is working from my end.
function onLoad() {
var fieldName = 'description';
var el = g_form.getControl(fieldName);
el.style.height = '200px';
}