Tagged: file upload, Required, validation
- This topic has 4 replies, 2 voices, and was last updated 5 years, 4 months ago by
jrcreative.
-
AuthorPosts
-
-
August 17, 2016 at 4:43 pm #7182
jrcreativeMemberI’m trying to make a field type of “file” a required field. It works fine when I do the initial file upload and a save the post, but validation stops the save on post updates.
Here’s my code for that field.. nothing fancy.
piklist('field', array( 'type' => 'file' ,'field' => 'government_id' ,'label' => __('Government Issued ID') ,'options' => array( 'basic' => true ) ,'required' => true ) -
August 17, 2016 at 6:49 pm #7186
jrcreativeMemberFWIW, the same behavior happens in front end forms and admin meta boxes. I tried the custom validation to check the existence of a file and got the same result. Is there a way to use a custom validation filter to address this?
-
August 22, 2016 at 3:41 pm #7216
jrcreativeMemberbump…
Has anyone come across this before? Any possible solutions I should be looking at?
-
August 23, 2016 at 11:41 am #7230
SteveKeymaster@jrcreative– Check out the VALIDATION tab in the Demos. We have a required
filefield there. -
September 13, 2016 at 3:18 pm #7334
jrcreativeMember@Steve I just got around to looking at the file validation tab in the demos, and it’s not actually checking a
filefield type. It’s evaluating the contents of atextfield to see if that’s a valid file.Can validation be done with a
filefield type?I don’t need it to validate that it’s a valid file, I would be satisfied if it validated as true if it sees a string of any kind stored in that post_meta field.
-
-
AuthorPosts
- You must be logged in to reply to this topic.