Welcome Guest, Not a member yet? Register   Sign In
Form Validation - Alpha Characters and Spaces and Dashes
#1

[eluser]drakeonfire[/eluser]
Hello,

I've done a bit of searching but can't really find what I need. If you can't tell I'm quite a newbie to CodeIgniter and I use DataMapper too.

I want to validate a form field to check if it only contains Alphabetical Characters (e.g. A-Z & a-z) and also spaces and dashes.

I thought the alpha form validation did this (except dashes), but apparently it doesn't accept spaces.

I know I could do it in a callback, but wanted to make sure it wasn't already a part of the system?

Also - is there a way to create a function / callback that can be used for the Controller and the Datamapper Models? Otherwise I'd have to create the function in both my controller and my model ... Sad

Thank you!




Theme © iAndrew 2016 - Forum software by © MyBB