Your script is working patnaik
I've done some testing, and it seems the problem only occures when I'm using a wysiwyg field within the html form. I've tried two different wysiwyg editors, but in both cases htmLawed didn't work when a wysiwyg field was submitted.
This is my test code with a wysiwyg editor (jqueryte, which can be found on jqueryte.com):
<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="/wysiwyg/jquery-te.min.js"></script>
<link rel="stylesheet" href="/wysiwyg/jquery-te.css">
<script>
jQuery(document).ready(function($) {
$("#message").jqte();
$("#message").jqteVal("");
});
</script>
<form id="qform" name="qform" method="post" action="qanswer.php" enctype="multipart/form-data">
<textarea id="message" name="message"></textarea>
<input type='submit' value='Submit form' id="send" name="send"/>
</form>
when I fill in
<script>alert('hi');</script>123
in the wysiwyg textarea and submit the form, my php code
$posting= htmLawed($_POST['message'], array('safe'=>1, 'deny_attribute'=>'style'));
echo $posting;
returns
<script>alert('hi');</script>123
so here it fails.
When I submit an other form without wysiwyg, like:
<form id="qform" name="qform" method="post" action="qanswer.php" enctype="multipart/form-data">
<textarea id="message" name="message"></textarea>
<input type='submit' value='Submit form' id="send" name="send"/>
</form>
this returns
so here htmLawed works perfectly.
I can't figure out why the wysiwyg editors give these problems. I hope you can help
me out, as I need this htmleditor on my website.