2014-01-10 45 views
0

我安裝了Typo3擴展「Formhandler」,一切正常。Typo3 formhandler驗證電子郵件後綴

但我希望表格只能發送,如果電子郵件後綴等於3其他人。

例,
我的表有一個字段 「電子郵件:_ __ _ ___」,
和形式,如果該字段包含只應提交

<something>@support.example.com 
<something>@web.example.com 
<something>@news.example.com 

哪有我這樣做?

回答

1

你可以用pregMatch錯誤檢查來做到這一點。

validators { 
    1.class = Validator_Default 
    1.config.fieldConf { 
    email.errorCheck { 
     1 = pregMatch 
     1.value = /\b[A-Za-z0-9._%-][email protected](support|web|news)+\.(example)+\.(com)\b/ 
    } 
    } 
} 
+0

這是一個正則表達式嗎? – fechnert

+0

是的,這是一個正則表達式。 Formhandler可以使用這裏描述的perl正則表達式http://www.typo3-formhandler.com/documentation/error-checks/strings/pregmatch/ – derhansen