cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
lonegijoe
Nintex Newbie

Choice Field Drop Down Values - Disable JS not working

I am attempting to disable values within choice drop down fields in Nintex Classic.

The issue is this:

I applied the following javascript to the customer javascript section in the form settings menu and it is NOT working.  Meaning, when I publish the form and then edit the item I still see the values I do not want them to select. I need the users to select certain values but be able to see other values that would be applied by workflow from other list,etc but not be able to update certain value themselves.

@I have to be missing something simple.

Fields have a point value, 0 value, and a Report value in each field, not necessarily same order(considered using CSS with setfield value can be different for fields).

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 formatting> CSS class for each control I added value of Test1 or Test2 ,etc to represent each control.  (if Test1, then I added Test1 ,   if Test 2 then I added Test2  to whatever CSS classes were already there.

I still do not have the values disabled.

Did I miss something? Thank you for any help!

Update: The custom CSS seems to work in Chrome but not in IE. Still can't get the Javascript to work.....

 .ttr option[value="12"] {display: none !important;}
.ttr option[title="12"] {display: none !important;}

Need form to hide the value in field in IE. 

HELP???!!!

 

L

0 Kudos
Reply
4 Replies
jpmhuls
Nintex Newbie

Re: Choice Field Drop Down Values - Disable JS not working

If this is for a choice field, and value visibility is based on a previously stored column value, in order to determine showing a value you may consider to use an if() construction for each choice value:

20

18

if(ChoiceProperty != 16,"16","")

if(ChoiceProperty != 14,"14","")

if(ChoiceProperty != 12,"12","")

if(PropertyColumn != 10,"10","")

So here the values 20 and 18 will allways be selectable, while 16/14/12/10 when a column PropertyColumn does not have its value.

This will not work when changing a value on the form; that would require a different solution.

0 Kudos
Reply
lonegijoe
Nintex Newbie

Re: Choice Field Drop Down Values - Disable JS not working

The values would need to work when a user is editing a form and looking at choices of a field.

They're all dropdowns.

Just trying to think how to apply to my scenario. 

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

Sounds like you are suggesting it may work to apply this rule to control/field and I can replace the values of your If statement with the ones for the fields as necessary?

Thanks,

L

0 Kudos
Reply
lonegijoe
Nintex Newbie

Re: Choice Field Drop Down Values - Disable JS not working

It's not working perhaps I mis-understood how to apply it or where to apply it. 

When I was trying exactly as you typed but with 12 being the value I did not want select I received the following error - 'ChoiceProperty' is undefined   

I am currently trying this as a rule for the control/field. 

if({Self}!=12,"12","")

...not sure how that would do what I'm trying to get it to do...

Please specify if you are meaning to try it elsewhere and exaclty what that would look like with choice of 12,0,Dispute. ) The item would show because it has a value of 0. I want them to be able to select Dispute but not 12.

12 is still available..

I was also thinking if this was infopath i'd just set it back to 0 if they chose 12 with a rule. Don't know how to do that with Nintex Forms.

Thanks for your patience,

L

0 Kudos
Reply
jpmhuls
Nintex Newbie

Re: Choice Field Drop Down Values - Disable JS not working

Maybe you could provide some screenshots which 1) give an impression of the form and involved fields and 2) which field(s) affects which dropdown's choices.

Reply