Accessing the DOM object in client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2024 11:23 AM - edited ‎10-23-2024 11:25 AM
I'm trying to get the text content from a HTML field (the content will be dynamic) and then display the value in another field (say 'description'). The client script I tried is not working as expected. The ID which is mentioned within the getElement() is for 'div' tag. For simple actions like button.click() is working but not when it comes to retrieving the text content.
Below is the code which I'm trying
var summaryText = g_form.getElement('gen-summaryText');
var strSummary = String.valueOf(summaryText);
alert(strSummary);
if (strSummary !== null) {
g_form.setValue('description', strSummary);
} else {
g_form.setValue('description', '');
}
Output:
function String() { [native code] }
Can anyone please pour your suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2024 07:48 AM
Thanks @Marcos Kassak, @jusfory1 for your suggestions, it is Now Assist for case summary.. so before the text is generated the div remains empty and once generated it is stored in another div. My bad with the ID name..
Before
After