- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 06:47 PM
Hello,
I am trying to create an onload client script to populate the description field with text when the field is not empty.
I am trying to use the following script:
function onLoad() {
if (g_form.getValue('description' !== ""))
{
return;
}
else
{
g_form.setValue('description','Questions: \n\n 1. System the issue is related to \n 2. What browser \n 3. On VPN/not on VPN \n 4. Reminder to include a screenshot \n 5. Best time/contact number to reach them on for more details');
}
}
The script works if the ticket already has text in the description field but the setValue text does not populate when I try to create a new ticket.
How can I get the setValue text to populate in the onload script when I create a new ticket?
Many thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 07:03 PM
Hi @jasonho
Try this script.
function onLoad() {
if (g_form.getValue('description') != ""){
return;
}else{
g_form.setValue('description','Questions: \n\n 1. System the issue is related to \n 2. What browser \n 3. On VPN/not on VPN \n 4. Reminder to include a screenshot \n 5. Best time/contact number to reach them on for more details');
}
}
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 07:03 PM
Hi @jasonho
Try this script.
function onLoad() {
if (g_form.getValue('description') != ""){
return;
}else{
g_form.setValue('description','Questions: \n\n 1. System the issue is related to \n 2. What browser \n 3. On VPN/not on VPN \n 4. Reminder to include a screenshot \n 5. Best time/contact number to reach them on for more details');
}
}
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 07:19 PM
Hi Anvesh,
The script works. Thank you so much.