• Resolved amirdorna

    (@amirdorna)


    Hi.

    Under some the fields I want to have a checkmark section if the field was not applicable to the client instead of leaving it empty they check mark and the field gets disabled.

    Is it possible?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @amirdorna,

    The easier alternative would be use dependencies.

    For example, including a radio button or DropDown field allowing the users select the user’s type, you can define dependencies for showing or hiding the dependent fields depending on the choice selected.

    More information in the following link:

    https://cff.dwbooster.com/documentation#dependencies

    Best regards.

    Thread Starter amirdorna

    (@amirdorna)

    Thanks for prompt reply.
    I tried dependency but it just says if I select that choice , Show , I.e. field 3

    There is nothing like hide field 3

    Plugin Author codepeople

    (@codepeople)

    Hello @amirdorna,

    The dependencies work in the opposite direction, the dependent fields are shown if the choice is ticked.

    If you want customize the dependencies, like in this case, the alternative would be use a calculated field as auxiliary.

    For example, assuming your form includes the input fields: fieldname1 and fieldname2, and the checkbox field: fieldname3, and you want hide the fields: fieldname1 and fieldname2 if the fieldname3 is ticked

    – Insert a calculated field with the equation:

    
    IF(fieldname2,0 , 1)
    

    Now, in the dependencies section of the calculated field define the following dependency:

    If value is equal to 1 then show the fields: fieldname1, fieldname2 (pressing the plus button you can associate multiple fields to the dependency)

    As the calculated field is used as auxiliary, it is not relevant in the form’s interface, so, you can tick the checkbox: “Hide Field From Public Page” in its settings.

    Best regards.

    Thread Starter amirdorna

    (@amirdorna)

    Will it work for example when I want to have a field as Middle Name, so if the person doesn’t have the Middle name they can check mark it so it will be hidden ?

    Plugin Author codepeople

    (@codepeople)

    Hello @amirdorna,

    This method can be used with every field in your form (except page break or session break).

    Best regards.

    Thread Starter amirdorna

    (@amirdorna)

    Perfect , Thanks I try it now

    Thread Starter amirdorna

    (@amirdorna)

    One More question,

    What I want is

    Fieldname1 (Text Area)
    Doesn’t Apply (Check Mark)

    Now I want if the person left the fieldname1 Empty, it force them to checkmark the “Doesn’t Apply”
    If They Filled the fieldname 1, No need to checkmark.

    Plugin Author codepeople

    (@codepeople)

    Hello @amirdorna,

    It is a different behavior, and will require some of code, because it is not a feature in the plugin.

    For example, assuming the textarea field is the fieldname1, and the checkbox the fieldname2 configured as required. If you want the checkbox won’t be required if the textarea is populated, you will need too insert a “HTML Content” field in the form, with a piece of code similar to the following one as its content:

    
    <script>
    jQuery(document).on('change', '[id*="fieldname1_"]', function(){
    var v = this.value;
    jQuery('[id*="fieldname2_"]')[(v=='')?'addClass':'removeClass']('required');
    });
    </script>
    

    and that’s all.
    Best regards.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Checkmark to disable a field’ is closed to new replies.