How to set multiple values in a textbox using jquery
<p>I have a text box. When I click on the listed data (Data is getting from table). I need to set response table row ID in text box.</p>

<p>I need data to set like this <code>"|13456|1400|14567|"</code> in the text box. 
Please help me to set id in text box. Currently I can set only one ID.
Please find the <a href="http://i.stack.imgur.com/I11FG.jpg" rel="nofollow">attached image</a></p>

<p><strong>JS</strong></p>

<pre><code>$.post("getDetailsAjax.php", {keywords: keywords}, function(data){ 
    $.each(data, function() {
        var leftboxid = this.id;
        var producer = this.producer;
        var model = this.model;
        var typ = this.typ;
        var body = this.body;
        var date_from = this.date_from;
        var date_to = this.date_to;
        var power = this.power;
        var engine_code = this.engine_code;
        var fuel = this.fuel;
        var ccm = this.ccm;
        var cylinders = this.cylinders;
        $('#search-result').append('&lt;div class="leftboxid_'+leftboxid+'" data-leftbox="' +leftboxid+ '"&gt;&lt;a href="#" class="list-group-item"&gt;&lt;p class="list-group-item-text"&gt;' +producer+ ' '+model+' '+typ+' ('+body+')&lt;/p&gt;&lt;p class="list-group-item-text"&gt;' +date_from+ ' to ' +date_to+ '&lt;/p&gt; &lt;p class="list-group-item-text"&gt;' +power+'  ps .' +engine_code+' . ' +fuel+ ' . '+ccm+' ccm . ' +cylinders+ ' cyl&lt;/p&gt;&lt;/div&gt;');
        /* right box */
        $(".leftboxid_"+leftboxid).on("click", function(){
            var setID = $(this).attr("data-leftbox");
            $(".append-left-id").attr("value", setID);
        });
    });
}, "json");
</code></pre>

<p><strong>Textbox</strong></p>

<pre><code>&lt;div class="col-xs-4"&gt;
    &lt;input type="text" class="form-control append-left-id" placeholder="Result Field"&gt;
&lt;/div&gt;
</code></pre>