chameleon-system/pkgformfielddoublecheck
Add double checks for user input form fields
README
You can use this package to add double check fields to any user input you want to.
- adds the class 'TPkgFormFieldDoubleCheck'
- add extensions for following packages if existing
- -TdbDataExtranetUser, MTExtranetCore (pkgExtranet)
- -MTPkgNewsletterSignup (pkgNewsletter)
- -MTShopArticleQuestion (pkgShop)
- if you installed one of these packages after this package you have to add the extension manually
Installation
if you want to add a double check for email fields you can use the twig templates in install folder. Package supports following forms on default.
Newsletter sign up All extranet user forms using function ExtranetUser->ValidateData() to validate fields (registration) Extranet e-mail change form Article question form
If you want to use the check on not supported forms use function in class TPkgFormFieldDoubleCheck to check your form data. And you have to add the double check field to your twig template similar to this.
{{ set doubleCheckNameValue = "" }} {{ if aFieldLogin.sError == '' }}
{{ set doubleCheckNameValue = aFieldLogin.sValue }}
{{ endif }} {% set aMappedData = {'sInputClass' : 'span4',
'sLabelText' : 'Feld wiederholen',
'sName' : 'aUser[_double_check_name]',
'bRequired' : true,
'sFieldId': "regUserGuestEMailDC",
'sError': '',
'sValue' : doubleCheckNameValue ,
'sHelpText': ''
}%} {% include "/common/userInput/form/text.html.twig" with aMappedData%}
The name of the field have to be _doubblecheck"name of the field you want double check".
If ypu want to prevent paste on double check fields you have to link or copy the package assets. to load the js file add the content in config.yml to your theme config.yml. This has to be added to global resources.