We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32300
    • 17 Posts
    For some reason allow tags is not working for me. I have tried both...

    [[!FormIt?
       &hooks=`addStock` &validate=`description:allowTags`]] 


    and

    ...name="description:allowTags"


    and both at the same time for what it’s worth and formIt is still removing tags from my textarea input. I’m confident it is a problem with formIt as when I remove...

                /* strip tags by default */
                if (strpos($k,'allowTags') === false && !is_array($v) && (!isset($validateFields[$k]) || !in_array('allowTags',$validateFields[$k]))) {
                    $v = strip_tags($v);
                }


    From formit’s validator class, then get rid of my allowTags calls it doesn’t remove tags.

    I’d just like to know if there’s something wrong with the way I’m asking for allowTags in the snippet call or perhaps there could be another reason?

    Any help would be appreciated.
      • 28215
      • 4,149 Posts
      Can you file that as a bug here?

      http://github.com/splittingred/FormIt/issues
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 32300
        • 17 Posts
        Certainly.
          • 13730
          • 149 Posts
          I use Formit version 1.5.3, and it working great.

          Here my snippet call :

          [[!FormIt? &hooks=`email,redirect` &emailSubject=`Inscription au déjeuner du 6 avril` &emailTpl=`emailDejTpl` &emailTo=`[email protected]` &redirectTo=`22` &validate=`entreprise:required, responsable:required, adresse1:required, ville:required, codepostal:required, neq:required, text:required:allowTags, tel:required, email:email:required, nospam:blank`]]
          


          But I have a little problem with the textarea field. I put my text on multiline in the textarea like this :

          Job1
          Job2
          Job3


          I use the allowTags for validate this field (text:required:allowTags) but I receive it like this in my email :

          Job1 Job2 Job3

          instead of

          Job1
          Job2
          Job3


          Could you indicate my mistake?

          Thank very much for your help.
          • The textarea is simply using \n (newline) characters; the email is most likely HTML and needs
            tags instead. Allowing tags doesn’t help, since you’re not using tags. You’ll need to either make sure the mail is sent as plain-text, or convert the nl2br (I’m sure there’s a filter to do that).
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 13730
              • 149 Posts
              You were right sottwell, there is actually a filter for that [[+text:nl2br]]

              Thanks again for your help