- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 10:43 PM
I want to change the style of a specific field using JavaScript based on a condition using Client Script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 10:49 PM
Hi there,
use getControl() in this scenario
Try specifying the condition in if statement and change the style using javascript like you normally do in DOM manipulations.
function onLoad() {
var a = g_form.getControl('number');
a.style = "background-color:blue;border-radius:50px;height:100px; ";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 10:49 PM
Hi there,
use getControl() in this scenario
Try specifying the condition in if statement and change the style using javascript like you normally do in DOM manipulations.
function onLoad() {
var a = g_form.getControl('number');
a.style = "background-color:blue;border-radius:50px;height:100px; ";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 10:51 PM
Thankyou for your assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 10:51 PM
You can use the control
var f = g_form.control('field_name');
f.style.background_color = value