- 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-23-2016 12:02 AM
Hi Tanumoy,
It says bad assignment.I tried the following code ,it seems to work but is not changing the font style when i click on a different one
function onChange() {
var style1 = g_form.getValue('u_font_style');
g_form.getControl('u_text').style.fontFamily = style1;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2016 12:05 AM
u_font_style.. is it a drop down field?
If yes, could you please give a screenshot of the choices of it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2016 12:09 AM
- 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');