We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16633
    • 116 Posts
    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?
      --
      Landon Poburan
      Web Designer and Developer

      http://www.categorycode.ca
      http://www.landonp.com
      • 28215
      • 4,149 Posts
      Try [[!+fi.error.nomination_file]]
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 16633
        • 116 Posts
        Quote from: splittingred at Nov 01, 2010, 05:32 PM

        Try [[!+fi.error.nomination_file]]

        Nope still didn’t work!
          --
          Landon Poburan
          Web Designer and Developer

          http://www.categorycode.ca
          http://www.landonp.com
          • 47633
          • 11 Posts
          3 years too late but I came by this post looking for the answer:

          [[!+fi.error_message]]


          Worked for me.