I'm trying to find the definitive way of validating whether a Safecracker File custom field has been filled in or not. The server side method using the Codeigniter validation class only semi works for me, and I'd much rather get client side validation working first anyway.

Has anyone found a reliable way of doing this? Ideally it'd be a validation library like parsley.js, but I can see that to use that you need to add data-validate="parsley" to the form element - something that isn't possible using Safecracker.

Any help much appreciated.


1 Answer 1


So this turned out to be fairly simple in the end. You just need to add the data-validate attribute to the form tag using jquery or vanilla JavaScript. Works a treat.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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