
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2020 10:44 PM
Hi All
I have an issue with one of my catalog items, where the RITM page on the portal is showing a hidden field after you submit the request.
For example, here is the form
a client script is hiding some fields (i am using a client script because the field values are being generated dynamically by another client script... it's a painful form)
however when you hit submit, one of the hidden fields is shown on the RITM page
There is a a UI policy that hides all these fields on form load, then the client script takes care of turning them on or off depending on what the user selects. Both the script and UI policy are set to apply to cat items, req items and cat tasks.
this is the script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (g_form.getValue('gis_request_category') == 'gis_map_production'){
g_form.setDisplay('gis_map_production_form',true);
g_form.setDisplay('gis_interactive_map_form',false);
g_form.setDisplay('gis_service_type',false);
g_form.setDisplay('gis_data_request_type',false);
g_form.setDisplay('gis_user_request_type',false);
}
else if (g_form.getValue('gis_request_category') == 'gis_interactive_map_request'){
g_form.setDisplay('gis_interactive_map_form',true);
g_form.setDisplay('gis_map_production_form',false);
g_form.setDisplay('gis_service_type',false);
g_form.setDisplay('gis_data_request_type',false);
g_form.setDisplay('gis_user_request_type',false);
}
else if (g_form.getValue('gis_request_category') == 'gis_imagery_services'){
g_form.setDisplay('gis_service_type',true);
g_form.setDisplay('gis_interactive_map_form',false);
g_form.setDisplay('gis_map_production_form',false);
g_form.setDisplay('gis_data_request_type',false);
g_form.setDisplay('gis_user_request_type',false);
}
else if (g_form.getValue('gis_request_category') == 'gis_data_management'){
g_form.setDisplay('gis_interactive_map_form',false);
g_form.setDisplay('gis_map_production_form',false);
g_form.setDisplay('gis_service_type',false);
g_form.setDisplay('gis_data_request_type',true);
g_form.setDisplay('gis_user_request_type',false);
g_form.clearValue('gis_user_request_type');
}
else if (g_form.getValue('gis_request_category') == 'gis_user_management'){
g_form.setDisplay('gis_interactive_map_form',false);
g_form.setDisplay('gis_map_production_form',false);
g_form.setDisplay('gis_service_type',false);
g_form.setDisplay('gis_data_request_type',false);
g_form.setDisplay('gis_user_request_type',true);
g_form.clearValue('gis_data_request_type');
}
else if (g_form.getValue('gis_request_category') != 'gis_interactive_map_request' | g_form.getValue('gis_request_category') != 'gis_map_production'){
g_form.setDisplay('gis_interactive_map_form',false);
g_form.setDisplay('gis_map_production_form',false);
g_form.setDisplay('gis_service_type',false);
g_form.setDisplay('gis_data_request_type',false);
g_form.setDisplay('gis_user_request_type',false);
}
}
Also if anyone knows how to get the RITM form to display the label for request category, rather than the value, that would be handy. The request category is one where the list values are generated dynamically (hence the need for a script)
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2020 11:14 PM
Hang on, i think i know
the script is clearing the values in the other two fields. Whereas service type has a value in it whether it's hidden or not, so i bet that's the problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2024 04:30 AM
is there anything in the variable after the form has been submitted? or is it empty?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2024 05:53 AM
I'm removing all option with g_form.clearOptions() when category is changed:
But when I submit the form, the value is displayed for Subcategory

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2024 11:52 PM
there's got to be something that's populating it.
Is there a default value?
have you tried g_form.clearValue(subcategory)? did you get the same thing?
any business rules or other client scripts running on that table that might be inserting a value when it's submitted or updated?
is it always the same value regardless of whats in the category field, or does it change dependant on whats in Category?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2020 11:15 PM
aah got it now.
is that same client script which you added , that's hiding the variable ?
why don't you use UI Policy here, no script required.