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
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

shanep - January 21, 2009 - 22:57
Title:Requiring the application top be uploaded...» How do I require the job application / file attachment to be uploaded?

Better title..

#2

gmarus - January 21, 2009 - 23:16

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

gmarus - January 21, 2009 - 23:16

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

gmarus - September 30, 2009 - 17:16
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.