Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.