1

I'm trying to retrieve and save a html formatted text submitted thru a Joomla editor field. I went thru some of the available docs (https://docs.joomla.org/Retrieving_request_data_using_JInput#Getting_Multiple_Values), but unfortunately I could not figure out why Joomla removes all the HMTL tags from the text agains all my efforts. I already set the filter type of the field to "raw":

<field
    name="Message"
    type="editor"
    label="Message"
    rows="10"
    cols="40" 
    filter="raw"
    class="gngcontact"
/>

I'm trying to use the below code to retrieve the field content after submission:

$input = new JInput;
$post = $input->getArray(array($_POST => 'RAW'));
GNGHelper::dump($post);

But this still results in a string without HMTL:

string(62) "Hello! Are there any tags in this line? There were some..."

What else do I need to do to be able to keep the tags in the resulting string?

Thanks a bunch! W.

1 Answer 1

2

Using $_POST as array key in getArray() argument is producing a warning:

Warning: Illegal offset type

If your form is using form control (normally jform), you can get unfiltered data like this:

$post = $this->input->get('jform', array(), 'raw');
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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