File upload field and Javascript validation

By: Hans Baumhardt | Asked: 05/31/2023
ForumsCategory: Code HelpFile upload field and Javascript validation
Hans BaumhardtHans Baumhardt asked 2 years ago

The File Upload field [ Required ] flag is only enforced when Javascript validation is enabled. 

 

BUT I need to enrich the form by parsing some uploaded file EXIF data into hidden fields which only works when Javascript validation is disabled.

 

With Javascript validation enabled the file upload field 'item_meta' is blank until frm_after_create_entry, so I cant get a file handle to read any data until then.

 

Which is usless as it misses the Zapier NewEntry workflow trigger. SO as a workaround I have Javascript validation disabled to get the file handle and generate custom $errors in my script to notify of an empty file upload.

 

WHILST the $errors work and display fine on normal text/number fields, they do not display at all on the File Upload field, which I am guessing that needs Javascript enabled again to display. Any alternatives ?

 

frm_validate_field_entry ... no file handle with javascript validation enabled.
frm_validate_entry ... no file handle with javascript validation enabled.
frm_pre_create_entry ... no file handle with javascript validation enabled.
frm_after_create_entry ... have file handle but missed the zap trigger.

 

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right