Text area - remove formatting

edited November 2011 in Modules
When a text data type is used, the default text area control is used for the models extending from the Base_module_model. How does one remove the text formatting to enter straight Javascript syntax within the text area control so it doesn't override with HTML formatting. Is there a way to disable the formatting?

Comments

  • edited 5:18AM
    Are you using CKeditor or markItUp? If you are referring to removing the markItUp or CKeditor controls you can add the class of "no_editor" to the field which will make it a normal textarea box.
  • edited 5:18AM
    I did that and when I save and it removes the markup. Am I still missing a tag to prevent overriding the content?
  • edited 5:18AM
    Basically, I am trying to insert Javascript within the content field and it's removing it after save.

    I.E.



    converts to

    [removed]
    [removed]
  • edited 5:18AM
    That sounds like something that CKeditor is doing. Does this happen when "no_editor" class is applied to the field (so neither CKeditor or markitup are used)?
  • edited 5:18AM
    Yes.
  • edited 5:18AM
    I'm dealing with the same issue. Did you ever get this figured out? Would appreciate any info on how you might have resolved this. Thanks.
  • edited 5:18AM
    Try changing the "sanitize_input " property of your module to something like:
    array('php', 'template', 'entities'). It's possible that one of those functions (e.g. the xss_clean function which it there by default), is causing that.
    http://getfuelcms.com/user_guide/modules/simple
  • edited 5:18AM
    Thanks for pointing me in the right direction. What I'm wanting to enter into the text field and save without being affected is some jquery/javascript so there are <script> tags. I think these are getting stripped out. I see php, template and entities, etc. but didn't see anything that would be directly related to javascript and tags. Do you know if there is anything?
  • edited 5:18AM
    Struggling to remember.. I think I've struck this before, is there any regex in your version of the cke config file? I remember I had to remove two regex lines in there .
Sign In or Register to comment.