We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32300
    • 17 Posts
    So I have...

    $store = $modx->newObject('sfStock');
    $store->fromArray(array(
        'catid' => $formFields['catid'],
        'title' => $formFields['title']...etc.


    Which is putting fields from a user submitted form into a database table. Thing is it seems to be removing html tags (<b>, <i> etc.) which for some fields I need as I’m giving the user the option of formatting textarea inputs with a wysiwyg text editor.

    I removed all the validation from my own code and still get this problem so I am wondering if xPDO is doing something I don’t know about.

    edit: Does a varchar mySQL field type strip these tags out? If so that may be my problem.
      • 22303 MODX Staff
      • 10,725 Posts
      fromArray() definitely does not strip anything from the fields. Validation in MODx is configured to occur on save() of the objects from the modx model. I do not believe MySQL will strip them either. I’m not sure what your issue could be, but I do not believe the problem is in the xPDO layer.
        • 32300
        • 17 Posts
        Ok thank you.

        In that case it might be a problem with the formit snippet I’m using. Could you tell me if this is wrong?

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

        description is a textarea which is given both the name and id: ’description’
          • 22303 MODX Staff
          • 10,725 Posts
          You might have better luck directing this to the FormIt support forums. Sorry, I have very little experience with that Add-On atm.
            • 32300
            • 17 Posts
            Ok thank you for your help.