Skip to content

Instantly share code, notes, and snippets.

@notxcain
Forked from thenixan/fields.xml
Created March 6, 2014 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notxcain/9383980 to your computer and use it in GitHub Desktop.
Save notxcain/9383980 to your computer and use it in GitHub Desktop.
<elements id="2">
<enumerationField name="account_type" title="Тип счета">
<values>
<value title="Номер счета" value="1" />
<value title="Номер карты" value="2" />
</values>
<dependancy>
<targets>
<target name="account_type" regularExpression="^1$" />
</targets>
<elements id="3">
<bankAccountField name="account" title="Номер счета" regularExpression="^\d{20}$" />
<bikField name="pfp" title="БИК" target="account">
<biks>
<bik value="1234567" />
<bik value="1234568" />
<bik value="1234569" />
<bik value="1234570" />
</biks>
</bikField>
</elements>
</dependancy>
<dependancy>
<targets>
<target name="account_type" regularExpression="^2$" />
</targets>
<elements id="4">
<bankCardField name="account" title="Номер карты" regularExpression="^\d{4} \d{4} \d{4} \d{4}$" />
<dateField name="exp_date" title="Срок действия карты" dateMask="MM/yy" />
</elements>
</dependancy>
</enumerationField>
<inputField name="name" title="ФИО получателя" />
</elements>
<!--
elements - set of fields that contains only *Field tags
inputField - default regexp-validated field
enumerationField - field with predefined values. Always has a values-value tags with possible values of the field.
bankAccountField - field with the input of the bank account number
bankCardField - field with the input of the bank card number
bikField - field with the input of the BIK number. Has target attribute which always points to the bankAccountField that has to be validated using specified BIK number
dateField - field with the input of the date
each field can optionally have a dependancy tag.
targets - dependency listens to the changes in the values of the fields defined in the name attribute and if all listed fields are successfully validated with the regularExpression than underlying elements becomes active/visible to the user/serialized to the protocol
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment