Let user ad javascript code

4 posts by 2 authors in: Forums > CMS Builder
Last Post: August 27, 2013   (RSS)

By Maurice - August 26, 2013

Hi all,

I created a textbox field without the wysiwyg.

Now I want a editor to add javascript but the code gets messed up and won't run.  how can i prevent that?

I checked the option "Disable auto-formatting (don't add break tags to content)" but that is not working either

Greetz Maurice

-------------------------------------------

Dropmonkey.nl

Hi Maurice, 

The best solution might be to have a separate text box field where the user can enter their JavaScript code, there are two benefits too this:

1)The JavaScript code won't be edited/affected by the WYSIWYG editor.

2)You can place the JavaScript code in the header, or below the body tag of the page. 

It is possible to stop the WYSIWYG editor from formatting the code, but it requires editing some core CMS Builder files, so we don't recommend it. 

Cheers

Greg

Greg Thomas







PHP Programmer - interactivetools.com

Hi Maurice,

How is the code being messed up? Is it not being run and displayed on the page? Or are random characters being added? Could you show me the code you're using to display the JavaScript on your page?

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com