Good afternoon, I have the following doubt:
I have a select field with more or less 100 options. In this current select, I choose an option and this chosen option is populated in a new input text ...
I wanted to put a "More" button and when I clicked create a new input text field ... now my doubt: it is possible using the same select I make a new choice and fill that new field without losing what it was filled in earlier?
I searched and found nothing that would do that, if anyone can give me a suggestion of how to do this, it would help me a lot.
Example:
<select class="form-control" id="frutas" name="frutas" autofocus >
<option value="">Selecione...</option>
<option value="Maca">Maça</option>
<option value="Uva">Uva</option>
<option value="Morango">Morango</option>
<option value="Banana">Banana</option>
</select>
And my job:
$('#frutas').change(function () { $('#nome_fruta').val($('#frutas option:selected').text());
});
In the example above, I choose a fruit and it fills an input with the value of select. Now I wanted to put a button to create a new field to receive another select fruit.
Att