Salve a tutti, ho un problema riguardo allo spostamento di più valori da un input text ad una text area. Ora vi spiego in dettaglio.
Ho un input type text e un tasto button al click del button il valore viene automaticamente inserito nella text-area. Fin qui tutto bene... Se provo ad inserirne un'altro vorrei che si aggiungesse ma invece me lo sostituisce come posso fare?
Qua il codice da modificare:
Jquery:
htmlcodice:$("#plus").click(function(){ $("#contoc").val(); var interesse = ""; $('input:text[name="contoc"]').each(function(){interesse += $(this).val() + ","}); $('#text').val(interesse); });
codice:<input type='text' name='contoc' id='contoc' size='40'><button id='plus'>Agg</button> <textarea id='text' span='60' rows='20'></textarea>

Rispondi quotando