cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Disable Choice Field Drop Down Values from being selected

Jump to solution

I have a bunch of independent Choice Fields.  Users are required to select an option that is respective of the status of the request...'New', 'In Process', 'Awaiting Final Approval', 'Complete'.  I need to disable the user from being able to select 'Complete'.  I need to keep 'Complete' as an option, as I have a workflow that checks if specific conditions are met (other fields in the form to be populated with a value), and will change the status to 'Complete' when those conditions are met.

How can I disable an option from the Choice field so it cannot be selected by a user?

Labels: (1)
0 Kudos
Reply
24 Replies
Workflow Hero

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

Hi Christine,

there is no builtin way to achive this. In classic forms you could go with javascript to disable single options but this is not available in the responsive forms designer. Also personally I don't find implementations like these intuitive for the user.

Would it be possible to let the workflow moderate the field? You could set the control to display only in the form and have the workflow change status from one status to another as it walks through its actions.

Like instead of manually changing the status from "In Process" to "Awaiting final approval" the workflow can set the status before it requests the approval or when a specific button ("request approval"?) is hit in the form.

Would that be an option?

Best regards

Enrico

0 Kudos
Reply
Workflow Hero

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

Hi Enrico,

Thank you for your feedback.  We are using the classic form, and we have 2 sets of users using the form.  External users and internal users.  The internal user, will be required to select the different statuses as they process through the request, but we do not want them to be able to select 'Complete'.  We will have a workflow check different items that are required to be filled in, and once everything is filled in, then the workflow will mark the status as 'Complete'.  Our initial thought was to remove the 'Complete' status so it did not even appear, but then you would not know when the request was Completed.  Additionally, our statuses are used as Radio buttons, so they all appear at the same time on the form.  Is there JavaScript that could be added to the field on the form that could disable the 'Complete' status radio button from being able to be selected?  What is the JavaScript code to do this, and where would this code get loaded onto the form?

Thank you,

Christine

0 Kudos
Reply
Workflow Hero

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

have a look on this post how to disable single radio option with CSS

https://community.nintex.com/message/82154-re-hide-a-radio-button-choice-through-javascriptcss?comme... 

0 Kudos
Reply
Workflow Hero

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

Thank you, Marian!

A few questions with that post (I believe that should do the trick).  Where do I put that coding?

Would you be able to explain the different sections to the coding below?  What do I overwrite with my specific information?

.MyChoice table.nf-choice-radio tr:nth-of-type(3) {
    display: none !important;
}

The below 3 screen shots are of one of my Choice fields in which I would need to 'disable' an option.  The option I want to disable is 'Complete'.   There are 8 options in total for this field.  I have 7 Choice fields in total in which I would need to disable the 'Complete' option.

Thank you!!!

0 Kudos
Reply
Workflow Hero

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution
Where do I put that coding?

forms setting >> custom css

or save to a separate file and place reference to the file in forms settings >> advanced >>Custom CSS includes

Would you be able to explain the different sections to the coding below? 

.MyChoice - identifies a control you want to change via a custom class

table.nf-choice-radio - identified a table that makes up a set of radio options of a above referenced control

tr:nth-of-type(3) - identifies 3rd row of a table referenced above

display: none !important; - configure 'display' style of table row referenced above to 'none'

 I have 7 Choice fields in total in which I would need to disable the 'Complete' option.

is 'Complete' option always on the same position?

if so, then above will perfectly work. just append for each choice control to 'CCS class" custom class 'MyChoice' (separated by a space)

0 Kudos
Reply
Workflow Hero

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

The 'Complete' option is not always in the same position.  The different Choice Controls do not always have the same number of choices so, would I need to add in this set of code for each Choice control? 

Example using the BAA status Choice control from above post:

.BAAStatus BAAStatus.nf-choice-radio tr:nth-of-type(7) {
    display: none !important;
}

BAA Status has 8 different Choice options.  'Complete' is the 7th option for this particular Choice control.

Would I just need to update the items above in Bold for each Choice control field?

Thank you so much for all your help!!!

0 Kudos
Reply
Workflow Hero

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

would I need to add in this set of code for each Choice control? 

yes.

.... yes, if you'd like to go with pure CSS solution

selector will however look like

.BAAStatus table.nf-choice-radio tr:nth-of-type(7)

 

in that case, of course, each control will have to have different class, and you have to address different rows.

but with so many controls javascript approach would more efficient, and will not need to be changed with every additional choice control added

the code might look like

NWF.FormFiller.Events.RegisterAfterReady(function(){
    NWF$('.MyChoice table.nf-choice-radio input[value="Completed"]').closest('tr').hide();
})‍‍‍‍‍‍‍‍‍‍

in this case, add the same class (eg. MyChoice) to the each choice control where you want to hide 'Completed' option from.

0 Kudos
Reply
Workflow Hero

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

Hi Marian,

Please see below screen shots.  Did I setup everything correctly?  It is not working, 'Complete' is still visible and able to be selected.

Thank you!

0 Kudos
Reply
Workflow Hero

Re: Disable Choice Field Drop Down Values from being selected

Jump to solution

no that's not correct.

into choice's 'CSS class' field append just 'BAAStatus' separated by a space from rest list of classes being already there (with no dot in front, and with no quotes)

then if you're implementing CSS solution, add CSS style definition into forms settings >> custom CSS.

if you're implementing javascript solution, add javascript from above into forms settings >> custom javascript

0 Kudos
Reply