On change of checkbox(s)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2025 07:56 PM
Hello @developers,
I have an implementation where on change of checkboxs i need to empty another variable, There are 7 checkboxs , so instead of writing onchange client script on each checkbox , how can i write this condition in simple steps.
Any help is appreciated, Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2025 08:55 PM
Can you share more details on when the requirement. on when the variable should be cleared so that I can understand better?
"I have an implementation where on change of checkboxs i need to empty another variable, There are 7 checkboxs , so instead of writing onchange client script on each checkbox , how can i write this condition in simple steps."
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
02-16-2025 11:01 PM
Hello @Chaitanya ILCR : on change of any checkbox need to empty one variable, let me know if this is not clear, Thanks!
Requirement is i need to check which checkboxs are ticked and which are not for restriction to raise a request . so i wrote a client script on change of that variable which needs to be emptied rather than on chnage of checkboxs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2025 01:19 AM
Hi @servicenow14710 ,
I had shared the UI Policies approach thinking if a certain criteria matches the value of the variable value should be cleared (let's say 3 check boxes are checked and 4 are unchecked)
but if you have to clear the value irrespective of values changes to true or false if you want to clear the value onchange client script is the way.
"on change of any checkbox need to empty one variable"
If I understand it correctly your requirement is let's say the checkbox is unchecked initially and users check it the value of the variable should be emptied and if they uncheck it again it should be emptied and so on..? and this should happen with all the 7 checkboxes too?
"Requirement is i need to check which checkboxs are ticked and which are not for restriction to raise a request ."
For this you can go with On Submit client script and check which check boxes are checked and which are not and restrict the users from submitting the request based on your conditions.
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya