@Momofiore
Create a rule on the control "demande d'information" by following the below steps:
- Click on the control "demande d'information"
- In the top ribbon, click on Add Rule
- Choose a name for the rule
- Go to formula and choose equals() from the inline function
- for the parameters, 1st parameter choose Statut from Named Control and 2nd paratmer will be "demande closed"
- the formula should be like this: equals(Statut , "demande closed" )
- then choose the behavior Disable or Hide.
Hello
@DimaHijaziin fact my Choice control name is ValidationPro and it has 3 choices (Refuser, Approuver, demande d'information).
I'de like to hide the third choice (demande d'information) when
Statut=="demande closed"
Your Suggestion is to hide the hole validationPro basing on my condition.
Hope I explained more.
Any suggetion?
Thank you again
Hello @Momofiore,
you can do it by adding a JavaScript to your form.
- Give a class name to 'Statut' control .StatutClass
- Go to control properties of the drop down control.
- In the Advanced section, select Store Client ID in Java Script Variable as yes.
- This will open option to name the variable. Name the variable myOptions and click save.
- Now open form settings and open the Custom Java Script section.
- Here you can write your script and access the drop down using the ID that you have given in step 3.
NWF$('.StatutClass').change(function(){
if(NWF$('.StatutClass') = 'demande closed'){
NWF$("#"+myOptions).find("option[value='Option 1']").prop('disabled',true)}
});
Hello
I wonder If you can help me to do the step 1:
Give a class name to 'Statut' control .StatutClass ?
Here is a screenshut for Statut
It would be under formatting (see screenshot below). in addition to @DimaHijazi 's suggestion, you should put your on change function within document ready function. See example code below where I am assuming the status field is a text input control. You probably want to re-enable the choice value if the status text is something else as well.
NWF$(document).ready(function() {
NWF$(".statusFieldClassName").change(function(){
if(NWF$(".statusFieldClassName input")[0].value == 'status changed')
{
NWF$(".choiceClassName").find("option[value='Choice 1']").prop('disabled',true)
}
else
{
NWF$(".choiceClassName").find("option[value='Choice 1']").prop('disabled',false)
}
});
});
Thanks you
@DimaHijazi and
@thomas_xu for the solution. I combined your solutions in order to get it. thank you!