Codeigniter表单不会将Javascript内联到控制器

Hi i am submitting my Codeignitor form to controller. Submitted data contain inline javascript with html code which i want to save into the database. But when i check the code after submitting then i realize that inline javascript is not there with the html code. e.g

<p><a href="#" onclick="myFunction();">Click Me!</a>here is a paragraph again!</p>

after submitting it becomes like,

<p><a href="#" >Click Me!</a>here is a paragraph again!</p>

i am using codeigniter standard method to post a form like

<?php
    $attributes = array('target' => '_blank', 'enctype' => 'multipart/form-data'); 
    echo form_open('controller/method',$attributes); 
    ?>

One more thing when i disable X-XS-Protection then it is working fine but i think it is a security issue. Any help would be very appreciative