- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 03:07 AM
Hello,
I would like to know how to change the font style of selected field. I have written the below code in on change of 'font style' field (it has list of font styles), which does not seem to work.
function onChange() {
var val = g_form.getValue('u_text');
val.style.fontFamily= g_form.getValue('u_font_style');
}
Thanks,
Sam
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2016 12:40 AM
OK... then use var style1 = g_form.getDisplayBox('u_font_style').value; instead of var style1 = g_form.getValue('u_font_style');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 03:33 AM
I feel you need to use gel for this one
1. Get the id of the field through developer tools in the browser
2. gel('<element id>').style.font-family=g_form.getValue('u_font_style');
Please mark the answer as helpful if found appropriate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 03:54 AM
Hi Arka,
I am getting the following error message 'Cannot read property style of null function'
Thanks,
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 03:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2016 04:02 AM
Hi Sam,
If you want to define style for individual fields on form view or list view, you can refer to below method.
Go to System UI > Field styles > new
Select the table on which concerned field(s) exist. select the field.
After this you can define the style by providing CSS properties.
For more info refer to Defining field styles : Geneva