Skip to content

Instantly share code, notes, and snippets.

@Schweriner
Created April 20, 2016 13:00
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 Schweriner/8405b4b9f69ba28cdea42649a793c197 to your computer and use it in GitHub Desktop.
Save Schweriner/8405b4b9f69ba28cdea42649a793c197 to your computer and use it in GitHub Desktop.
Conditional Formhandler ErrorCheck
##########################################################################
# KONTAKTFORMULAR
##########################################################################
plugin.Tx_Formhandler.settings.predef.contact {
name = Terminwunsch
addErrorAnchors = 0
formValuesPrefix = formhandler
isErrorMarker.default = error_class
errorListTemplate.totalWrap = <div class="error"><strong>Es sind Fehler beim Ausfüllen des Formulars aufgetreten:</strong><ul>|</ul></div>
errorListTemplate.singleWrap = <li>|</li>
singleErrorTemplate.singleWrap = <span class="error">|</span>
singleErrorTemplate.totalWrap = |
masterTemplateFile = fileadmin/was/tmpl/modern/ext/formhandler/bs-mastertemplate.html
validators.1 {
class = Tx_Formhandler_Validator_Default
config {
fieldConf {
name.errorCheck.1 = required
telefon.errorCheck.1 = required
email {
errorCheck.1 = required
errorCheck.2 = email
}
nachricht {
errorCheck.1 = required
errorCheck.2 = minLength
errorCheck.2.value = 10
}
}
}
}
if {
1 {
conditions.OR1.AND1 = email!=
isTrue {
validators.1.config.disableErrorCheckFields = telefon
}
}
2 {
conditions.OR1.AND1 = telefon!=
isTrue {
validators.1.config.disableErrorCheckFields = email
}
}
}
finishers.1.class = Tx_Formhandler_Finisher_Mail
finishers.2 {
class = Tx_Formhandler_Finisher_SubmittedOK
config {
returns = 1
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment