I’m developed an extension to add validation to the text field type. Once this extension is enabled you’ll see a drop down when your editing (or creating) a text field. Choose from the list to validate entries against a specified regular expression. Or if you’re feeling adventurous, switch the field type to a Drop-down List and enter a regex in the textarea like so:
v:/^[a-z]+$/i
Just note that all the regex’s have to start with a ‘v:’ followed by the expression. Fell free to add as many php-valid modifiers as you’d like. The above would ensure that the field is composed of all alphanumeric characters.
1.0.1 Downloads: 2 1.0.2 Downloads: 15
You got it cocoaholic, it snuck in there from my Multi-text extension. I’ve since removed it and added new settings so that if you define your own regular expression match you can then define your own error message in the settings page. Enjoy, version is 1.0.2 at the top of the thread.
Another request to have this work with SEAFs. It looks like the validation works, but instead of getting the user message template with the error message when and invalid field is submitted, I get a blank screen. I would love to be able to use this extension on a current project. 😊
Anyone have this working with ee 1.6.7?
The list that the extension provides seems to work, but when you try to do something custom using the Drop Down fieldtype and the regex in the dropdown, you just get a drop down for that field where you can select the regex you put there. I even just copied the exact regex Mark put in his post as an example just to be sure it wasn’t my expression that was the problem.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.