- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 08:05 AM
There are 2 dropdown options for admin to select. If the admin select option #2 and type something in reference field search box but changed mind and select option #1, the ui reference field will change but the previous ui reference field still have remaining input value that need to be cleared. If click Option #2 again, it will switch back to first reference field but the old value that admin typed is still there. I have tried use gel('test').value = ""; but it isn't working. Anyone know why?
Here are my sample code,
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 11:29 AM
Try:
document.getElementById('sys_display.test').value = '';
document.getElementById('test').value = '';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 11:29 AM
Try:
document.getElementById('sys_display.test').value = '';
document.getElementById('test').value = '';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 11:35 AM
That worked! Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2022 06:33 AM
This, plus this bit from another SN Community post[1] worked for me:
document.getElementById("company-referenceLINKreplace").style.display = "none";
Credit here goes to
[1] https://community.servicenow.com/community?id=community_question&sys_id=713a774adb21ec50fa192183ca9619cd