- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 02:08 AM
Hello,
please, how to do:
one checkbox field be checked and mandatory , if the state of request changed to closed
thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 06:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 02:44 AM
Hi Saini
thank you
please i need it with onchange client script, because i have others tasks(another field will be displayed if the checkbox is checked) before close request .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 07:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 02:58 AM
Hello,
So What I understood is You have a checkbox field when made true it will make another field appear so you want the field to be checked always when the state is changed to closed.
There are two approaches to this:-
1) Make field mandatory and true so no one can really save the form without checking it
Onchange client script will be as below:-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var state = g_form.getValue('state');
if (state == '7')//State value of Closed
{
g_form.setMandatory('fieldname',true);
g_form.setValue('fieldname',true);
}
else
{
g_form.setMandatory('fieldname',false);
}
2) Make field true and read-only when state changes to close so that no cna can make it false(Better way)
Onchange client script will be as below:-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var state = g_form.getValue('state');
if (state == '7')//State value of Closed
{
g_form.setReadOnly('fieldname',true);
g_form.setValue('fieldname',true);
}
else
{
g_form.setReadOnly('fieldname',false);
}
}
Please mark answer correct/helpful based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 06:15 AM
Hello,
Did you get a chance to see my code
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 06:28 AM
Thank you Saurav