We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48103
    • 3 Posts
    Hi,

    I am struggling with what should be a simple contact form. In its basic form (name, telephone, email) I can get the form working and e-mailing. The issue I have is when I try to put some drop sown option boxes into the form. I have used the online example as a guide, but every time I OK the HTML (even before saving the page), it looks like MODX is stripping out the code. I have even copied and pasted the example into the code and this too is being stripped out when I OK the HTML.

    Has anyone come across this? Is there something I'm missing from the snipit to allow drop down options in a FORMIT form?

    thanks in advance

    thorney
      • 28042 ☆ A M B ☆
      • 24,524 Posts
        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
        • 48103
        • 3 Posts
        Thanks for the reply.

        I've taken a look at this, I have copied that example and the moment I click OK to the html edit this is what the code turns to

        <select name="color">
        <option value="blue">Blue</option>
        <option value="red">Red</option>
        <option value="green">Green</option>
        <!-- This would also work -->
        <option value="yellow">Yellow</option>
        </select>

        To be honest, I haven't used MODX before and I have inherited this site that is running on it. Could there be something amiss with the setup?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Are you doing this in TinyMCE or one of the other rich-text editors? If you are, either disable it for that resource or put the form in a chunk and call the chunk in the resource.
            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
            • 48103
            • 3 Posts
            I think you have got it.

            A quick test and all looks OK. Will look at properly later.

            Thanks for your help
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              That is why I never use those rich-text editors. I usually use Ace, and configure the system to use it for resources as well as elements. I also have a not-quite-finished package for using MarkItUp, which is an interesting non-Rich Text editing tool that has buttons for creating various HTML entities as well as buttons for accessing the File Browser for inserting images and links to files.

              You can also assign the editor (or none) on a per-user basis, using the Settings tab on the user's page.
                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
                • 49220
                • 1 Posts
                I am having the same issue with select drop down boxes not saving, but my editor is fine.

                I copied the sample form and snippet from the provided tutorial into a new document and tested.

                http://rtfm.modx.com/extras/revo/formit/formit.tutorials-and-examples/formit.examples.simple-contact-page

                The validation will work, however the checkboxes and select drop down default to their original unselected values. You must then select them again. I figured after reviewing the section "FormIt.Handling Selects, Checkboxes and Radios", I would have a clearer understanding, but this does not discuss re-populating the fields, it only explains the validation, which is separate feature.

                I assume I may need to add the 'FormItIsSelected' and 'FormItIsChecked' somewhere to run the snippet, but no luck with that either.

                I am also running [[!formItRetriver]] at the start of my form, but it's only working for text input fields.

                Is there a way for select, checkboxes, and radios, to actually retain their selected values? I am working on a long survey and need these values saved on validation refresh.