Error related to shft+enter and enter with Jquery
<p>When I type 'hello??' in text area (id = add_new_comment) it inserts <strong>hellojQuery1704879437133033947_1333718592556??</strong> in database. What's the problem with the code? Thanks in Advance</p>

<pre><code>    $('#add_new_comment').live('keyup',function (event) {

            /*shft+enter for new line*/

        if (event.keyCode == 13 &amp;&amp; event.shiftKey) {
           $(this).val($(this).val()+"\n");

           return false;   
        }else if(event.keyCode == 13){
            /*code to be inserted in db*/
        }
    });
</code></pre>

<p>Database code (ie. model in codeigniter)</p>

<pre><code>function add_new_comment($comment, $store_id, $comment_source,$user_id) {
        $data = array(
            'comment' =&gt; $comment // comment to be inserted. This contains the text of textarea.
            'source_id' =&gt; $store_id,
            'comment_source' =&gt; $comment_source,
            'from_user_id' =&gt; $user_id
        );
        $result = $this-&gt;db-&gt;insert(COMMENTS, $data);

        return $this-&gt;db-&gt;insert_id(); 
    }
</code></pre>

<p>js script (actual code):</p>

<pre><code>$('#add_new_comment').live('keyup',function (event) {
               if (event.keyCode == 13 &amp;&amp; event.shiftKey) {
                   $(this).val($(this).val()+"\n");

                   return false;   
               }else if(event.keyCode == 13){

                   var store_id = "";

                   store_id = $('.c_store_comment').attr('id');

                   var new_comment = $.trim($(this).val());

                   $.ajax({
                    type:'post',
                    url:path to controller,
                    data:'comment='+new_comment+'&amp;store_id='+store_id,
                    dataType:'json',
                    success:function(vals){
                        $.each(vals,function(i,values){
                            switch (i) {
                                    case 'error':
                                        alert('Sorry Something went Wrong');
                                    break;

                                    case 'success':
                                        var comment_div = '&lt;div class="col1_comment2_row"&gt;&lt;div class="col1_comment2_row_tilte"&gt;'+$('.user_name').html()+'&lt;/div&gt;';
                                        comment_div += '&lt;div class="col1_comment2_row_img"&gt;&lt;a href="#nodo"&gt;&lt;img class="delete_comment" id="'+values[1]+'" src="/images/delete_comment.png"&gt;&lt;/a&gt; &lt;/div&gt;';
                                        comment_div += '&lt;div class="col1_comment2_row_cooment"&gt;'+values[0]+' &lt;/div&gt;&lt;/div&gt;';


                                        $('.c_store_comment .scroll_container').append(comment_div);
                                        $('#add_new_comment').val('');

                                    break;
                                }                   
                        });
                    }
                   });         
               }
            });
</code></pre>
