Well, let me start with the error:
This error is given whether the field is filled or not. When I removed the requirement from the field, the image was not uploaded.
Relevant code pt 1: The Form
Relevant code pt 2, the source template:
Possibly Relevant Info:
I've got the form within a routable template. No errors are being thrown, however, and I have several other forms within routable templates that work without error.
The template containing the form is not within the root folder; but, again, neither are several other forms that are working correctly.
image_file: Required field cannot be left empty
This error is given whether the field is filled or not. When I removed the requirement from the field, the image was not uploaded.
Relevant code pt 1: The Form
- Code: Select all
<div class='panel panel-primary'>
<div class='panel-heading'>
<h2>Upload a New Image</h2>
</div>
<div class='panel-body' >
<cms:form masterpage='relation_gallery.php' mode='create' method='post' role='form' anchor='0'>
<cms:if k_success >
<cms:db_persist_form
_invalidate_cache='0'
/>
<h4 id='successMessage' class='alert alert-success'>Your image has uploaded!</h4>
<script>
setTimeout(function() {
$('#successMessage').fadeOut('slow',function() {
$(this).alert('close');
})
}, 2500);
</script>
</cms:if>
<cms:if k_error >
<div class="error alert alert-danger">
<a class="close" data-dismiss="alert" href="#" aria-hidden="true">×</a>
<cms:each k_error >
<br><cms:show item />
</cms:each>
</div>
</cms:if>
<div class='form-group'>
<div class='row'>
<div class='col-md-8'>
<label>Image Title</label><br/>
<cms:input class='form-control' type='bound' name='k_page_title' />
</div>
<div class='col-md-4'>
<label>Image Type</label><br/>
<cms:input class='form-control' type='bound' name='gallery_name' />
</div>
</div><br/>
<div class='row'>
<div class='col-md-6'>
<label>Image Upload</label><br/>
<cms:input type='bound' name='image_file' />
</div>
</div><hr/>
<div class='row'>
<div class='col-md-3'>
<button role='submit' class='btn btn-primary'>Submit</button> <button role='button' onclick='window.history.back()' class='btn btn-default'>Cancel</button>
</div>
</div>
</div>
</cms:form>
</div>
</div>
Relevant code pt 2, the source template:
- Code: Select all
<?php require_once ($_SERVER["DOCUMENT_ROOT"] . "/couch/cms.php" ); ?><cms:template name='relation_gallery' title="New Gallery" hidden='1' clonable='1' routable='1'>
<cms:editable type='dropdown' required='1' name='gallery_name' label='Gallery Name' opt_values="**Please Select**=- | Childrens=child | Young Adult=ya | Columbia County=cco | Euchee Creek=ec | Harlem=har | Burke County=bco | Sardis=sar | Midville=mid | Lincoln County=lco | Warren County=wco | Systems=sysmsg" />
<cms:editable type='securefile' name='image_file' allowed_ext='png, jpg, jpeg, gif' max_size='8192' width='800' height='600' thumb_height='80' show_preview='1' use_thumb_for_preview='1' required='1' />
</cms:template>
<?php COUCH::invoke(); ?>
Possibly Relevant Info:
I've got the form within a routable template. No errors are being thrown, however, and I have several other forms within routable templates that work without error.
The template containing the form is not within the root folder; but, again, neither are several other forms that are working correctly.