Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there way to use custom validation on an advanced custom field? For example, I might not want a textfield to have a value that starts with certain prefix, or I might want a number field to have a value greater than 'x'. I might also want to run a regex against a value and return an error if it doesn't match.

share|improve this question
What is an advanced custom field exactly? – GhostToast Sep 26 '12 at 19:09
1  
Another thought for client side validation would be to use something like the bassistance.de jQuery validation plugin and enqueue that for the admin section along with your own admin javascript file that defines the fields and types. – Jared Cobb Sep 26 '12 at 19:16

1 Answer

up vote 2 down vote accepted

There is now, I just posted a plugin that I wrote to do validation for Advanced Custom Fields to the Wordpress repository. It lets you do server side validation using either PHP code or regex, jQuery masked inputs, as well as unique value settings.

http://wordpress.org/extend/plugins/validated-field-for-acf/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.