0
Personal how to insert a text to this Textarea without Modifying the value that is already inside it when filling in the inputs?
I have a preview https://jsfiddle.net/orpwmc5b/3
when I type in "input" it deletes the pre-defined value...
some way to add without removing when filling in the input?
html code
<b>MEU NOME: </b>
<input type="text" name="fname" id="i1"><br>
<b>Cidade:</b>
<input type="text" name="lname" id="i2"><br>
<b>Estado:</b>
<input type="text" name="fname" id="i3"><br>
<b>Meu Bairro:</b>
<input type="text" name="company" id="i4">
<textarea id="i5">Texto predefinido que nao pode apagar</textarea>
Jquery javascript code
<script>
$( function() {
function updateTextarea() {
$( '#i5' ).val( $( '#i1' ).val() + '\n\n' + $( '#i2' ).val() + '\n\n' + $( '#i3' ).val() + '\n\n' + $( '#i4' ).val() );
}
$( '#i1, #i2, #i3, #i4' ).keydown( updateTextarea );
});
</script>
Thank you all for your help! ^^
Awesome ! saved me THANK YOU!
– Thiago Vinic