I built a CRED form for a CPT with some conditional fields that display depending on what term is selected from a Custom Taxonomy select dropdown. The form seems to be working properly for all fields except the File Upload field.
My form code is as follows:
[credform class='cred-form cred-keep-original']
[cred_field field='form_messages' value='' class='alert alert-warning']
<div class="form-group">
<label>Submission Name OR Title (to be displayed on this site)</label>
[cred_field field='post_title' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label>Select Type of Submission</label>
[cred_field field='submission-type' display='select' single_select='true' output='bootstrap']
</div>
[cred_show_group if="($(submission-type) eq '18' )" mode='fade-slide']
<div class="form-group">
<label>Video Link</label>
[cred_field field='video-link' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label>Audio Link</label>
[cred_field field='audio-link' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>
[/cred_show_group]
<div class="form-group">
<label>Description of this submission and why it is relevant</label>
[cred_generic_field field="post_content" post="submissions" type="textarea" class="" urlparam="" output='bootstrap']
{
"required":0,
"validate_format":0,
"persist":0,
"default":""
}
[/cred_generic_field]
</div>
[cred_show_group if="($(submission-type) ne ARRAY('18','12','17','16') )" mode='fade-slide']
<div class="form-group">
<label>Course Title & Number</label>
[cred_field field='course-title' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label>Course Level</label>
[cred_field field='course-level' post='submissions' value='' urlparam='' output='bootstrap']
</div>
<div class="form-group">
<label>Institution</label>
[cred_field field='institution' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>
[/cred_show_group]
[cred_show_group if="($(submission-type) ne ARRAY('15','13','14'))" mode='fade-slide']
<div class="form-group">
<label>Original Source</label>
[cred_field field='original-source' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>
[/cred_show_group]
<div class="form-group">
<label>Contributor Name</label>
[cred_field field='contributor-name' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label>Contributor Email</label>
[cred_field field='contributor-email' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>
[cred_show_group if="($(submission-type) ne '18' )" mode='fade-slide']
<div class="form-group">
<label>Select files to upload to repository (Word, Excel, PowerPoint, PDF etc.)</label>
[cred_field field='file' post='submissions' value='' urlparam='' output='bootstrap']
</div>
[/cred_show_group]
[cred_field field='form_submit' value='Submit' urlparam='' class='btn btn-primary btn-lg' output='bootstrap']
[/credform]
I have no Access restraints set on this form at the moment but even when logged in as an Admin, I cannot submit any files to the form. When a file is selected, the progress bar displays making it look as if the file is being uploaded, but then a popup message displays on the screen with the following message "The Form you submitted has expired. "Please refresh the page and try again" (see screenshot).
How do we fix this?
By the way, the above problem persists regardless of whether AJAX is enabled or not. Also, the message displays as soon as the file upload progress bar completes -- meaning before the Submit button is clicked.
Forcing https for entire site fixed the issue.