cwentzel
Novice

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

Thank you again so much for all your help and patience!

Reply
lonegijoe
Novice

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

Team/Christine,

Having a similar scenario. Problem is that I mirrored what you did for multiple choice fields and the values are not disabled even after copying line for line what your solution showed above. Fields have a point value, 0 value, and a Report value in each field, not necessarily same order.

IE:

12

0

Report

Here is what I have for the form custom javascript settings:

NWF.FormFiller.Events.RegisterAfterReady(function(){
NWF$('.Test1option[value="16"]').prop('disabled',true);
NWF$('.Test2 option[value="14"]').prop('disabled',true);
NWF$('.Test3 option[value="12"]').prop('disabled',true);
NWF$('.Test4 option[value="16"]').prop('disabled',true);
NWF$('.Test5 option[value="16"]').prop('disabled',true);
NWF$('.Test6 option[value="16"]').prop('disabled',true);
NWF$('.Test7 option[value="10"]').prop('disabled',true);
})

in CSS class for each control I added value of Test1  or corresponding value of each control. (if Test 1, then I added Test1    if Test 2 then I added Test2  to whatever CSS classes were already there just like above screenshots

Seems pretty straight forward  but nothing is grayed out in the values when selecting from drop-down.

Any Help is appreciated, Thank you!

L

0 Kudos
Reply
cwentzel
Novice

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

I'm trying to understand your scenario. 

Tes1, Test2, Test3, etc...they are all different Choice fields on your form?  Are they all drop downs?  Do you have any that are radio buttons?

What Choice options should display in your drop downs?  I'm seeing multiple scenarios above where the same value is trying to be disabled.

Please post a screen shot of your form, and possibly the setup of you different Choice fields (Test1, Test2, Test3, etc.)

0 Kudos
Reply
lonegijoe
Novice

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

Hi Christine! They're all dropdowns (probably biggest difference from your scenario but looked easy enough using the code you provided). I got the CSS to work in a different browser but it won't work in IE11. Still can't get the javascript to work. 

Test 1 is now TicketTrouble_Rating

  • Dropdown field
  • CSS Class is TicketTroubleRating
  • IE 11
  • Nintex Forms 2016
  • Javascript added to customer javascript area in form settings

Field values are : 

12

0

Dispute

If the item has a 0 for this field, the field shows up. They can choose dispute. I do NOT want them choosing 12. It needs to be there though since item is copied over from different list per a workflow and can sometimes be a the 12 value.

My other fields are all dropdowns and similar in values but the full number value sometimes changes.

for TicketAccuracy_Rating the value I don't want them to select is 16:

16

0

Dispute

Javascript is here: 

NWF.FormFiller.Events.RegisterAfterReady(function(){
NWF$('.TicketCompAccRating option[value="16"]').prop('disabled',true);
NWF$('.TicketTroubleRating option[value="12"]').prop('disabled',true);.

This should work but is not for some reason..... What did I miss?

Using CSS works in Chrome but not in IE 11. and the values I don't want just don't show at all - which is ok. (seems to be an issue with Display: None per google search.

Development Site

CSS

.TicketTroubleRating option[value="12"] {display: none !important;}
Hope this makes more sense.
Thank you!
L
0 Kudos
Reply
cwentzel
Novice

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

After comparing your setup with how my form is setup, I am not seeing any differences.

The only thing I could suggest that would be causing it to not work, would be due to the fact that those fields are being pre-populated with value from another list.

Have you tested with not pre-populating the data fields from another list?

0 Kudos
Reply
brightlight
Scout

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution
Is there a way to hide instead of disabling using JavaScript as below:

NWF$('.Status option[value="Approved"]').prop('disabled',true);
NWF$('.Status option[value="Rejected"]').prop('disabled',true);
0 Kudos
Reply
cblackl2000
Scholar

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

Thank you for this and I especially appreciate the screen shots.  I'm not certain that I will put this in my solution but it is exactly what I'd like to do!

0 Kudos
Reply
cblackl2000
Scholar

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

I have also implemented an alternative solution to put a rule on the field for

  • contains([ChoiceFieldName],"Value user cannot choose") to then invalidate that selection

This works quite nicely and cuts to the chase for many instances.

0 Kudos
Reply