Form php to update a text area value with html tags

porlhews

Member
Hi all,

I have a form which is updated by several users.

I have a textarea element which I would like to use to compare the update made by each user and then populate a html table which highlights the changes.

It appears the updateFormData function cannot handle html tags:

Code:
$string_history = "<table>
    <tr>
        <td>".$diff['old']."</td>
        <td>".$diff['new']."</td>
    </tr>
</table>";


$formModel->updateFormData('tablename_history', $string_history, true);

I get the following error; 0 syntax error, unexpected '<', expecting ';'

Ive ran tests omitting html tags and that worked.

Any ideas?

Thanks in advance :)
 
Try with $string_history = htmlspecialchars(...);
(But I'm not sure if it's decoded on output).

What is your textarea setting, did you enable WISIWYG?
 
Back
Top