- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 03:07 AM
Hi all,
Is there a way to clear all values on a CI form?
I could put them all in an array and loop through them, but as I have a lot of variables, I was wondering if there is a more efficient way to do this or if the array is the best way to go?
Any help would be much appreciated.
Kind regards,
G
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 03:22 AM
Hello @gunishi
var fields = g_form.getEditableFields(); for (var x = 0; x < fields.length; x++) { g_form.setValue(fields[x], ""); }
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 03:22 AM
Hello @gunishi
var fields = g_form.getEditableFields(); for (var x = 0; x < fields.length; x++) { g_form.setValue(fields[x], ""); }
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 03:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 11:59 AM
I tried this coding and it worked, but i want to refresh a catalog item if lets say the request type changes. So i did an onchange script so that when the field request type is changed i excute the code:
var fields = g_form.getEditableFields(); for (var x = 0; x < fields.length; x++) { g_form.setValue(fields[x], ""); }
but what is happening is yes all the values on the catalog item is cleared and if I go back to the request type field to start to fill out the catalog item again it just keeps resetting the catalog item. Basically I want to be completing a catalog item and lets say i was 3/4 completed and then decide to change the type and enter a different value in the request type and a whole new set of fields are presented. I start to answer those questions and then decide to go back to the value in the request field that I had to begin with and when I do all the values still remain. Is there a way that I can clear out or 'reset' the whole catalog item?