Allow HTML code in JRequest

use html

If you need to get HTML code from JRequest then you need to use special parameter:

JREQUEST_ALLOWHTML

Example (Joomla! 1.6.x-3.x) ↓

$value = JRequest::getVar( 'field_name', '', 'post', 'string', JREQUEST_ALLOWHTML );

Note ↓

      JREQUEST_NOTRIM – prevents trimming of whitespace
      JREQUEST_ALLOWRAW – bypasses filtering
      JREQUEST_ALLOWHTML – allows most HTML. If this is not passed in, HTML is stripped out by default.


in Joomla! 3.x you can use RAW parameter

$app = JFactory::getApplication();
$jinput = $app->input;
$result = $jinput->get('param_name', 'default_value', 'RAW');

Also exists another parameters: INT, INTEGER, UINT, FLOAT, DOUBLE, BOOL, BOOLEAN, WORD, ALNUM, CMD, BASE64, STRING, HTML, ARRAY, PATH, USERNAME, RAW
More information about Jinput on the official Joomla site: Retrieving request data using JInput
Here you can see: How to allow html code in Joomla editor field