How do I require the job application / file attachment to be uploaded?
shanep - January 20, 2009 - 19:48
| Project: | Job Posting |
| Version: | 5.x-1.4 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
What would I need to add to the aplication upload form (just a file attachment) to make it required? Currently the Cover Letter is the only item required but I need to switch it. I don't need the cover letter but I do need the application to be required. Thank you much!

#1
Better title..
#2
Since Drupal's form api doesn't support a 'required' attribute on 'file' fields you'd have to create your own validation function as indicated on this page: http://api.drupal.org/api/file/developer/topics/forms_api_reference.html.... Alternatively you could try adding an appropriate 'else' clause to the relevant conditionals in job_posting_application_form_validate() and job_posting_application_form_submit() and see how that works for you in testing.
#3
Since Drupal's form api doesn't support a 'required' attribute on 'file' fields you'd have to create your own validation function as indicated on this page: http://api.drupal.org/api/file/developer/topics/forms_api_reference.html.... Alternatively you could try adding an appropriate 'else' clause to the relevant conditionals in job_posting_application_form_validate() and job_posting_application_form_submit() and see how that works for you in testing.
#4