3

The Tridion Field Behavior Injection (FBI) GUI extension adds additional, configuration information to Schemas to change the behavior of the Component Form views based on those Schemas.

I see a script and config for the Validator functionality. Was this part working and does anyone have a screenshot for the email and zip code examples?

2

The validator was working when I last checked, it uses regular expressions mostly. There's a dedicated "behavior" for "max length" validation. On top of the script there are a few validations defined in the configuration section:

<behaviour enabled="true" allFieldTypes="false" name="validation" handler="Tridion.Extensions.UI.FBI.Behaviours.ValidationBehaviour" areaHandler="Tridion.Extensions.UI.FBI.SchemaFieldValidation">
      <!-- Only SingleLineTextField (1) and MultiLineTextField (2) -->
      <allowedFieldTypes value="3"/>
      <validation type="email" name="EmailLabel" error="DefaultErrorMessageLabel">
        <regex>
          <![CDATA[^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$]]>
        </regex>
      </validation>
      <validation type="phone" name="resources:PhoneLabel" error="resources:DefaultErrorMessageLabel">
        <regex><![CDATA[^\d{10}$]]></regex>
      </validation>
      <validation type="zip" name="resources:ZipLabel" error="resources:DefaultErrorMessageLabel">
        <regex><![CDATA[^\d{5}(?:[-\s]\d{4})?$]]></regex>
      </validation>
      <validation type="price" name="Price" error="Field {0} is not a price! Come on!">
        <regex><![CDATA[^\d+(,\d{1,2})?$]]></regex>
      </validation>
    </behaviour>

The "allowedFieldTypes" (as the other behaviors) will determine to which fields the validation will apply, then you also need to "check" the field for "validation" in the Schema definition.

If you have issues with it, let me know, I will take a look.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.