6

I have a form which has been created in a CRM and then the code copied in to the website and updated to make it look and read better.

However, when I copy the code in, the "script" at the bottom of the form that does the form validation to ensure the required fields are completed is NOT saving?

I am using TinyMCE Editor in Joomla 3.5 and have updated the settings to allow script by removing it from the 'Prohibited Elements' section within the Plugin itself but its still not working. I have also updated the "Text Filter" to No Filtering.

The web page I am testing it on at the moment is here: http://www.lsl.global/index.php/application-form

Any ideas?

3

I have had similar issues in the past where scripts seem to be stripped regardless of the text filter settings.

Temporarily Disable Editor

As a temporary work around, you can temporarily set the Default Editor to "None" each time you edit the content.

This works but is not convenient especially when you or another administrator forgets to disable the editor and you lose the code when saving an update.

Sourcerer

Another option which works well regardless of the editor or text filter settings is the free or paid version of Regular Labs Sourcerer or similar.

Sourcerer ensures code embedded within {source}{/source} tags in your content is preserved.

1

We were never able to solve this with Tiny MCE either. As Neil suggests, you merely turn it off entirely while using it, or utilize Sourcerer from the component formerly known as NoNumber.

Alternative:

Install JCE as your editor. There you have the ability to set it to allow script, iframes, etc, and you have a better editor with more control at the end of it. JCE isn't perfect, but it solves a lot of problems Tiny MCE never seemed to work around.

1

TinyMCE removes empty tags by default, so a tag like <script src="myScript.js"></script would be removed because it's empty.

You can try changing the settings of the TinyMCE plugin (Extensions -> Plugins -> **Editor - TinyMCE) and add the following text to the Extended Valid Elements field.

script[*]

TinyMCE allow empty tags

That should allow you to add JavaScript directly in the TinyMCE editor, just make sure you paste the code into the code view, not the WYSIWYG editor. It also seems to work with inline scripts (<script>alert("Testing");</script>)

This method is also very useful for empty tags used for icons etc. Adding i[*] to Extended Valid Elements would allow you to use Font Awesome icons without having the code removed:

<i class="fa fa-joomla" aria-hidden="true"></i>

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.