I have created a custom formit hook to upload files. Everything works great, but if their is an error like, file didn’t upload or file isn’t allow (based on extension) I want to throw and error. (Right now I am using the following code taken from
http://rtfm.modx.com/display/ADDON/FormIt)
// File not uploaded
$errorMsg = ’File not uploaded.’;
$hook->addError(’nomination_file’,$errorMsg);
return false;
Unfortunately this does not display anything in my form here:
<div class="row clearfix">
<div class="label">Supplementary Files
<span class="error">[[+fi.error.nomination_file]]</span></div> <!-- end of .label -->
<div class="input"><input id="nomination_file" name="nomination_file" type="file" value="[[+fi.nomination_file]]" maxlength="100000" /></div> <!-- end of .input -->
</div> <!-- end of .row -->
How do I get the errors to show on the form?