Welcome, Guest
Username: Password: Remember me

TOPIC: HTML in textarea

HTML in textarea 24 Jan 2012 19:39 #1061

  • duetltd
  • duetltd's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
adding HTML to textarea gets stripped out during save, is there an easy way to allow html in selected textarea fields?
The administrator has disabled public write access.

Re: HTML in textarea 24 Jan 2012 20:40 #1062

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Yes, choose the "Rich-text" datatype.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: HTML in textarea 24 Jan 2012 20:50 #1063

  • duetltd
  • duetltd's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
This causes the editor to load I am trying to have plain text and html sniplets included - in joomla I think there is a flag for allowing html in text

Thanks!
The administrator has disabled public write access.

Re: HTML in textarea 25 Jan 2012 18:32 #1088

  • duetltd
  • duetltd's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
In joomla there is extensive use of xml files for fields and forms, according to what I could find there is a filter="raw" that can be added to allow html in a textarea however I am not sure where to add this. Any suggestions will be gratefully appreciated.

Thanks!
The administrator has disabled public write access.

Re: HTML in textarea 09 Mar 2012 15:08 #1538

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
In your controller :

function save() AND apply()

// Check for request forgeries
JRequest::checkToken() or jexit( 'Invalid Token' );

$cid = JRequest::getVar( 'cid', array(), 'post', 'array' );
$post	= JRequest::get('post');
$post['id'] = (int) $cid[0];

//HERE THE SYNTAX
$post['my_rich_text'] = JRequest::getVar('my_rich_text', '', 'post', 'string', JREQUEST_ALLOWRAW);



And...
in the check() function of your table file, don't apply any filter on it (as the others typed fields)
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: duetltd

Re: HTML in textarea 20 Mar 2012 01:19 #1672

  • duetltd
  • duetltd's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Your suggestion works perfectly - thank you!!! I have learned more about joomla here than every where else put together!

Thanks for all the help!
The administrator has disabled public write access.

Re: HTML in textarea 20 Mar 2012 06:27 #1674

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Thank you for your interrest and your incouragements.

Best regards.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.065 seconds

Get Started