• Resolved Damn!

    (@greedymind)


    Hello,

    How do I disable (grey out) all other fields if a number field is empty? and should be enabled once the user fills in a value in the number field.

    *other fields include sliders and calculated fields.

    Thanks in advance.

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

    (@codepeople)

    Hello,

    You should create dependencies, but through the dependencies you are not disabling/enabling the fields, you’re hiding/showing them. The dependencies are associated only to the following fields:

    – Checkbox
    – Radio Button
    – DropDown
    – Calculated Field

    So, if you want to create dependencies for a number field, you should insert a calculated field (as auxiliary field) whose equation check the value of the number field and return a result, and based on the result you define the dependency rule for showing or not the rest of fields.

    Note: as the calculated field is used as auxiliary, it is not needed in the form’s interface, so, you can tick the property: Hide Field From Public Page

    More information about the use of dependencies with the calculated fields in the following link:

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

    Best regards.

    Thread Starter Damn!

    (@greedymind)

    Hello,

    I know how to show or hide them, but what I want to know is if it is possible to grey out certain fields on a condition, meaning the fields should be visible but inaccessible to the users?

    Thanks.

    Plugin Author codepeople

    (@codepeople)

    Hello @greedymind,

    In this case you should convert the fields in readonly, or editable, but this code must be implemented by yourself as part of your equations:

    for example, assuming you want convert the input field: fieldname1 in readonly, include the following piece of code as part of your equation:

    jQuery('[id*="fieldname'+'1_"]').prop('readonly', true);

    To make the field editable again:

    jQuery('[id*="fieldname'+'1_"]').prop('readonly', false);

    Best regards.

    Thread Starter Damn!

    (@greedymind)

    Thanks a lot. I’ll be sure to try it out and let you know.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disable fields’ is closed to new replies.