We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37059
    • 368 Posts
    I am trying to edit the Formit lexicon so that "This field is required" will instead read "Name is required" (for instance). This is so that I can bunch the errors together at the top of the page instead of putting them by each field in the form. Taking a clue from another lexicon entry, I tried "[[+field]] is required" but that came out with blank space where the field name should have been. Is there any way to do this? Thanks.
      Jason
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      If there’s not a way to do that, it’d make a great feature request...
        • 3749
        • 24,544 Posts
        Did you try [[+fieldName]] or [[+fi.fieldName]] in your form? Whatever is used for the caption in the form should be available for use in the error message line.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 37059
          • 368 Posts
          Quote from: BobRay at Dec 08, 2010, 01:44 AM

          Did you try [[+fieldName]] or [[+fi.fieldName]] in your form? Whatever is used for the caption in the form should be available for use in the error message line.


          I assumed you mean using [[+fieldName]] or [[fi.fieldName]] in the lexicon entry. I have tried that and no joy. I even tried putting a call to FormItRetriever on the same page with the contact form just in case that would trigger something.

          Any other ideas, anyone?
            Jason
            • 9207 ☆ A M B ☆
            • 2,475 Posts
            I think Bob meant for you to put those placeholders in the relevant form chunk, not the Lexicon.
              • 37059
              • 368 Posts
              Quote from: Everett at Dec 08, 2010, 11:56 AM

              I think Bob meant for you to put those placeholders in the relevant form chunk, not the Lexicon.

              It almost sounded like that and maybe I’m a little dense today, but where would I put them? Concatenated with the error messages? How would the parser know which was which?
                Jason
                • 3749
                • 24,544 Posts
                Quote from: kenquad at Dec 08, 2010, 11:58 AM

                Quote from: Everett at Dec 08, 2010, 11:56 AM

                I think Bob meant for you to put those placeholders in the relevant form chunk, not the Lexicon.

                It almost sounded like that and maybe I’m a little dense today, but where would I put them? Concatenated with the error messages? How would the parser know which was which?

                Good point. It would show all the time unless you used a separate placeholder for it and I’m not sure how you’d set it. Shaun might have an idea.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 28215
                  • 4,149 Posts
                  It’d require the name of the field currently being parsed passed into the error message tpl parsing.

                  File? http://github.com/splittingred/FormIt/issues/
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 37059
                    • 368 Posts
                    I’d love to file a feature request for field names in error messages. How do I get set up to file one on your Github?
                      Jason
                      • 28215
                      • 4,149 Posts
                      You get a GitHub account and file one, I think.
                        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com