Text align in read only field form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 01:14 PM
Hi Team,
I have been trying to align text to the right in a read only (or disabled) field.
Following script works with active fields, but it does not work for read-only fields:
function onLoad() {
var el = g_form.getControl('volume');
el.style.textAlign='center'; //DOM manipulation
}
Also tried other approaches with no luck:
$j('#fieldId').css("text-align" ,"right");
Note: This style is for Form only. List format is OK.
Please help.
Thank you,
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 01:24 PM
Hi Eduardo,
I think field styles are the best way to achieve this requirement. Check this link for reference.
Thanks,
Nitin.
Hit Like, Helpful or Correct based in the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 01:29 PM
Hi nitin_kumar thank you for following up.
I took a look at the resource that you shared.
We want to apply two different styles, one for Forms (text align right) and one for lists (text align center) .
Is it possible to create one field style for form and one for list view? Please advise
Thank you again,
Regards.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2021 08:15 AM
Were you able to figure this out?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2021 08:55 AM
Hey eduzol,
You can simply navigate to System UI > Field Styles > New Create new style for which field you want to change text alignment and enter style in that style table.
For Ex- if I want to change the caller field text alignment on incident table then i have to create new field style .Take table name as incident , field name as Caller ,value as javascript:1=1,and style as
text-align:right
Try this once and If my answer is helpful then please mark it as helpful and correct.
Thanks