Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • MuirisOG 378 posts 1276 karma points
    Nov 20, 2018 @ 11:50

    Multi-language layouts

    We've noticed a problem with v2.0.0.0

    Our forms have bilingual fields, and so we used the layout to determine which fields to output.

    Some fields are required if the English form is displayed, and some are required if the Welsh form is displayed.

    However, if a field in the Welsh form is marked as required, it causes the English form to fail.

    The problem occurs in both the Angular JS and in the Plain Javascript versions.

    It didn't happen in the version we are on now (v1.3.0.0)

    Does this mean we need a separate form for both languages?

  • Nicholas Westby 1940 posts 6527 karma points c-trib
    Nov 20, 2018 @ 15:31
    Nicholas Westby

    This is likely due to a change in 1.5.0:

    You can set enableServerSideValidation to false if you want the old behavior (as explained in the above release page).

    Alternatively you can create your own custom "Client Side Required" validation that doesn't do any server side validation (i.e., it always indicates on the server side that the value is valid).

    And like you mention, another idea would be to create two separate forms.

    If you really want to dig into this, I would also be open to talking about a pull request in which validations are aware of the layout used (e.g., so they only validate if they're in the layout). That might be a bit if a bigger task though.

    EDIT: Another idea would be to have one set of fields, but then translate them in the template. You could create dictionary items for each field, or use whatever translation system makes sense to you.

  • Nicholas Westby 1940 posts 6527 karma points c-trib
    Nov 20, 2018 @ 19:37
    Nicholas Westby

    BTW, I just remembered you can also click this checkbox:

    Required Field in Formulate

  • MuirisOG 378 posts 1276 karma points
    Nov 21, 2018 @ 13:59

    Many thanks Nicholas.

    I tried the config file and that worked, but the checkbox trick didn't.

    In any case, we've decided that the simplest solution is to rewrite our forms so we have a separate form for each language.



  • Nicholas Westby 1940 posts 6527 karma points c-trib
    Nov 27, 2018 @ 17:02
    Nicholas Westby

    Hmm, I'll have to look into the checkbox issue at some point.

    Glad you found a solution.

Please Sign in or register to post replies

Write your reply to: