Reset the select box to none if i select a checkbox on catalog form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 01:38 PM
Hi Everyone,
I am trying to reset the select box to none if i select a check box on the catalog form.
like if i select some option and then click the checkbox it should reset to none.
Like in above snapshot when i select checkbox the select box should remain as none.
But my issue is that even if i select the checkbox it is showing possibility to select an other option.
when we select that box there should not be any possibility to select another option , if we select some option also it should reset to none.
Can anyone please help me out to resolve this issue.
Thank You In Advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 01:41 PM
Use UI policy and make the field read only. Also if your field was set to mandatory then make it nonmandatory as well as you are making it read only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 02:01 PM
Hi Ashish Nahar,
What you have suggested is almost met my requirement but still i have an issue with that.
As shown in the above snapshot when i select some option and select the check box the select box is displaying the previous selected option but i need it to be reset to none after i select the check box.
can you please help me out.
Thank You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 02:06 PM
You can achieve that by on change client script, if the value change in the
select box to true, it should clear out the value in the other field and
make it read only as well.
Don't do it through UI policy but do it through client script.
Check will on achieving this using g client script. Sorry I am replying
from my mobile.
On Jun 14, 2017 12:02 AM, "naresh1" <community-no-reply@servicenow.com>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 02:09 PM
Write onchnage client script on check box
Try below script
- function onChange(control, oldValue, newValue, isLoading, isTemplate) {
- if (isLoading ) {
- return;
- }
- if (newValue == true){
- g_form.setValue('selectbox variable', '--None--');
- }
- }