I am using SDL WEB 8.1.
I am trying to add the schema field restriction to Text type field. Restriction of field is minimum and maximum 12 characters.
I have an idea to implement using GUI extension but the requirement via xsd change in schema.
I have followed the below links information but not able to achieve, could you please help me out.
- How to add field constraints to a Schema
- http://nunolinhares.blogspot.co.uk/2012/07/validating-content-on-save-part-1-of.html
Taken from comments
<xsd:schema xmlns:xsd="w3.org/2001/XMLSchema"; xmlns="uuid:7176e2ea-b262-458d-a692-87947328b203" xmlns:tcmi="tridion.com/ContentManager/5.0/Instance"; elementFormDefault="qualified" targetNamespace="uuid:7176e2ea-b262-458d-a692-87947328b203"> <xsd:import namespace="tridion.com/ContentManager/5.0/Instance"; schemaLocation="cm_xml_inst.xsd"></xsd:import> <xsd:annotation> <xsd:appinfo> <tcm:Labels xmlns:tcm="tridion.com/ContentManager/5.0">; <tcm:Label ElementName="txtAlpha" Metadata="false">Enter the text</tcm:Label> </tcm:Labels> </xsd:appinfo> </xsd:annotation> <xsd:element name="txtEmailContent"> <xsd:complexType> <xsd:sequence> <xsd:element name="txtAlpha" minOccurs="0" maxOccurs="1" type="xsd:normalizedString"> <xsd:annotation> <xsd:appinfo> <tcm:ExtensionXml xmlns:tcm="tridion.com/ContentManager/5.0"></…; </xsd:appinfo> </xsd:annotation> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element>
<xsd:simpleType name="datatypeString"> <xsd:annotation> <xsd:documentation> Alpha Numeric field of length 4-10 characters</xsd:documentation> </xsd:annotation> <xsd:restriction base="xsd:normalizedString"> <xsd:minLength value="4"></xsd:minLength> <xsd:maxLength value="10"></xsd:maxLength> </xsd:restriction> </xsd:simpleType> </xsd:schema>