- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 12:41 AM
Hello Everyone,
I have a custom form in which I created one String field. I want to make the outline of the field as Red when the user enters the character in it more than it's limit. Is there any way we can configure this.
Please let me know.
Thank you,
Abhi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 12:57 AM - edited 03-07-2024 12:59 AM
Hi @Abhi369
Please use the below code in your onChange client script for that specific field.
if(newValue.length>10)
{
var myField = 'short_description';
var ctrl = g_form.getControl(myField);
ctrl.style.borderColor = 'red';
}
Please refer to the snippet for a better understanding
Please mark this as helpful and accept it as a solution if this works for you so that it would be helpful for others too.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 12:57 AM - edited 03-07-2024 12:59 AM
Hi @Abhi369
Please use the below code in your onChange client script for that specific field.
if(newValue.length>10)
{
var myField = 'short_description';
var ctrl = g_form.getControl(myField);
ctrl.style.borderColor = 'red';
}
Please refer to the snippet for a better understanding
Please mark this as helpful and accept it as a solution if this works for you so that it would be helpful for others too.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 01:25 AM
@Abhi369 , you need to design Client Script for this and It should be On Change of Short Description
Make Isolate to False
var control = g_form.getControl('u_short_description');
if(g_form.getValue('u_short_description').length>100){
control.style.color = 'red'; // to set the color of field
}
else{
control.style.color = ''; // clear it
}
Regards,
Shyamkumar
Regards,
Shyamkumar