Glide modal: Change textarea field dynamically based on another field value
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2023 10:07 AM
Hello, I am learning a Glide Modal on the Agent Workspace. I can put some fields there and do the work when submitting it.
But, I would like to have the option we are having on forms with onChange() client script. When I write something in the first field, I would like to have it written dynamically in another. Something like on the screen:
I assume it would be something simple, but I haven't figured it out. Could you hint to me a little? Thank you
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2023 12:29 PM
Oh, I see that I didn't provide you with the script. Here it is:
function onClick(g_form) {
var fields = [{
type: 'textarea',
name: 'subject',
label: getMessage('Adjust the subject'),
mandatory: true,
value: 'Something...'
}];
fields.push({
type: 'textarea',
name: 'readonly_subject',
readonly: true,
label: getMessage('Your subject is'),
mandatory: true,
value: fields[0].value
});
g_modal.showFields({
title: "The Email",
fields: fields,
size: 'lg'
}).then(function(fieldValues) {
alert(fieldValues.updatedFields[1].value);
g_form.save();
});
}