Client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 01:26 AM
Hi guys ,
State choice = Closed should be hidden from the form if State = new, for Change Tasks
for that I have written on load client script :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 01:31 AM
Hi @tushar_ghadage ,
Try this
function onLoad() {
//Type appropriate comment here, and begin script below
// g_form.addOption('state', '3'); you don't need this
if (g_form.getValue('state') == '1') {
g_form.removeOption('state', '3');
}
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 01:38 AM - edited 06-25-2025 01:42 AM
Hi @tushar_ghadage ,
Try to add else part in script to show the closed state.
Or remove this line from script - g_form.addOption('state','3');
Please mark my answer correct if it helps you.
Thanks
Anshul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 03:19 AM
yes i tried the same but its hiding it for all the options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 03:56 AM
Hey @tushar_ghadage ,
As we can see in your screenshot, the mandatory fields are empty in the form, which mean you have not saved the form. You need to save the form to make it work as it's onLoad client script and not onChange.
***************************************************************
Hope the answer helps!
Happy Learning!