default text in Description field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 09:20 PM
Hi Team
when ever user selects ' Request category is ' remove ser access '. below text has to populate in description field .
How to achieve this in onchange cilent script .
NOTE - Description field where calling from Variable set .
Text :-
Exmaple text is required .
Please priovde sciript .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 10:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 09:36 PM
Hi @nameisnani ,
Can u check wht is the backend name for Request User Access? Is it the same wht u have entered in the script? request_user_access.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 09:43 PM
you can use the below script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (newValue == 'remove_user_access') { // validate the field name
// Get a reference to the 'Description' field
var descriptionField = g_form.getControl('description');
// Set the desired text in the 'Description' field
descriptionField.value = 'Example text is required.';
}
else {
// Set the 'Description' field value to an empty string
descriptionField.value = '';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 10:21 PM
@Maddysunil @Lkharat @Danish Bhairag2 @Aniket Bhanse
where I missed , can anyone please help me here .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2024 10:28 PM
Update your code like this:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (newValue == 'remove_user_access') { // validate the field name
// Get a reference to the 'Description' field
//var descriptionField = g_form.getControl('description');
// Set the desired text in the 'Description' field
g_form.setValue('description','Your text here');
}
else {
g_form.setValue('description','');
}
}