We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48657
    • 17 Posts
    Hey guys, i have a - hopefully not too noobish - question

    How can i make formit2db to send source code ?

    This is my Code

    <div id="detail">
               <label for="detail">Detail:[[!+fi.error.detail:notempty=`<span class="label label-important">This is a required field</span>`]]</label>
                  <div class="controls">
                      <textarea name="detail" rows="6" cols="32">[[!+fi.detail]]</textarea>
                  </div>
          </div>


    Now i want to submit source code ... like i wanna type in
    <img src="abc.gif" /> This is a image
    but when i do this, it's being totaly ignored and all is being submit is
    "This is a image"

    any suggestions on this ?

    This question has been answered by sottwell. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      What do you mean by "send source code"? Send it where?
        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
        • 48657
        • 17 Posts
        my submit button puts it into a new database entry. but this doesn't matter at all...
        I have several validation requirements as parameters....

        ...[[!+fi.detail]]...

        forces it to keep the desired text in my text area even if submitting causes errorss becaus of validation

        If my Textarea contains following:
        This <h2> is a </h2> test


        and i get (e.g.) a error because of validation, my textarea becomes:

        This is a Test


        And so will it also be sent in my database, without the brackets and the stuff in between
        • discuss.answer
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Sounds like a strip_tags being used in there somewhere. Maybe something like this?
          [[!FormIt? &validate=`text:required:stripTags`...
            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
            • 48657
            • 17 Posts
            That helped me , thank you very much !

            So by the way: How can i get a WYSIWYG Texteditor running with Formit2db ?
            I tried Tinymce but i just get plain text out of it