We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13460
    • 47 Posts
    I want to show an errormessage WITH the applicable field(s).
    &validationErrorMessage=`<div class="span5 alert alert-error"><p>Some generic errormessage:</p><ul>[[+errors]]</ul></div>`
    &validationErrorBulkTpl=`<li>[[+error]]</li>`	
    




    I have to show which error belongs to which field otherwise these messages are useless. I don't want the inline messages near its input. I can't find it in the docs and in the forum. How to accomplish?!
      UI /UX designer + bit of Front-End Developer. Getting around with MODx Revolution
      • 13460
      • 47 Posts
      Bump! nobody?
        UI /UX designer + bit of Front-End Developer. Getting around with MODx Revolution
        • 37582
        • 65 Posts
        Might be hard as the field name itself is part of the markup (e.g. label-Tag) and therefore not known to formIt except your label matches your name-Attribute of the input type.

        What you can do (not very handy):

        [[!+fi.error.mail:notempty=`<li>Field email must contain valid mail address.</li>`]]
        
        • You can also add parameters to FormIt call like

          &mail.vTextRequired=`The emailaddress is required!`

          See: http://rtfm.modx.com/display/ADDON/FormIt.Validators#FormIt.Validators-CustomErrorMessages
            MODX Ambassador (NL) & Professional MODX developer
            Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
            MODX e-commerce solution SimpleCart
            • 13460
            • 47 Posts
            thanx guys for responding! I could do that BUT I want also show the restrains and that would accumulate it tremendously. For my 4 fields would be empty, min and max so 12 I lied 10 error-messages to insert by hand.. bieboebieboe!

            Wouldn't this be a nice feature for FormIt?! Let say [[+errors]] placeholder would also output [[!+fi.error.key]] or [[!+fi.error.name]] or whatever to insert some human-readable field-names. [ed. note: jambek2003 last edited this post 11 years, 4 months ago.]
              UI /UX designer + bit of Front-End Developer. Getting around with MODx Revolution