Require authors to submit a file

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 20
Joined: Sun Oct 11, 2009 10:30 pm

Require authors to submit a file

Postby bdm » Tue Jan 21, 2014 10:10 pm

Version 2.3.6.

Our submission step 2 has just an upload field with "Browse.." and "Upload" buttons, then the "Save and Continue" and "Cancel" buttons as usual.

What we would like to do is force authors to submit a file at this step before going on to the next step. All too often they select a file then forget to click "Upload".

Is there a nice way to do that?

If checking that a file is actually uploaded is too hard, can we at least require that the "Upload" button is clicked before "Save and Continue" works?


Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Require authors to submit a file

Postby asmecher » Wed Jan 22, 2014 5:48 am

Hi Brendan,

Have a look at templates/author/submit/step2.tpl (the step 2 template for the author submission process). The submit button code looks like this (with a little extra formatting for readability)...

Code: Select all

    <input type="submit"{if !$submissionFile} onclick="return confirm('{translate|escape:"jsparam" key="author.submit.noSubmissionConfirm"}')"{/if} value="{translate key="common.saveAndContinue"}" class="button defaultButton" />
    <input type="button" value="{translate key="common.cancel"}" class="button" onclick="confirmAction('{url page="author"}', '{translate|escape:"jsparam" key="author.submit.cancelSubmission"}')" />
The onclick="..." pops up a confirmation modal checking if the user is sure they want to submit without uploading. It's still possible to continue, but authors need to confirm.

If you want to force an upload, you can remove the onclick="..." entirely and disable the "submit" button if no file is uploaded, e.g. for that element...

Code: Select all

    <input type="submit"{if !$submissionFile} disabled="disabled"{/if} value="{translate key="common.saveAndContinue"}" class="button defaultButton" />
Alec Smecher
Public Knowledge Project Team

Posts: 20
Joined: Sun Oct 11, 2009 10:30 pm

Re: Require authors to submit a file

Postby bdm » Wed Jan 22, 2014 11:43 pm

That's very helpful, thank you.

Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 1 guest