We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26027
    • 145 Posts
    I'm trying my best to support a client with a MODx CMS system I didn't install.

    They need me to supply a form for a specific situation. I have such a form but it requires javascript for error checking. Every time I add an onSubmit to the FORM tag the editor removes it. The company that installed this system installed TinyMCE as the only editor.

    Can anyone tell me how to get around this problem. It makes no sense to me that this editor is so forbearing.

    Please help me if you read this and can.

    Thanks ... Sam
      • 26027
      • 145 Posts
      I'll close this thread with a solution I came upon:

      Originally I "solved" the issue by deselecting the tinyMCE editor in favor of "none". So doing allowed me to enter Javascript's onSubmit statement. The downside of doing it this way is that any subsequent attempt to edit this resource defaults to the tinyMCE editor. If I would click "html" and then "cancel" (not "update") the Javascript would be removed. In other words the "cancel" is not honored.

      I then learned that what I should have done was to use the "settings" tab and uncheck "Rich Text". At this point we lose all WYSIWYG capability but every further attempt to "edit" the resource shows the raw html coding. In My case that's exactly what I wanted.

      I think that it's too bad we can't have it both ways. Once the javascript is entered it seems buggy for the tinyMCE editor to remove it when "Rich Text" is then set back on.

      Hope this helps someone of you. It cost me over 4 hours,

      -- Sam