Questions with select array

Asked

Viewed 30 times

2

I don’t have much knowledge in javascript, I wonder if it is possible, when changing a main select, update the others to select the same information from this main.

Example: I will choose the main currency of a form of payment. When selecting it, I would like the X installments below to be updated to also select the same currency:

<label>Moeda Principal</label>
<select id='principal' onchange='atualizar()'>
    <option value="1">Dinheiro</option>
    <option value="2">Cheque</option>
</select>

<label>Parcela 1</label>
<select name='parcela[]'>
    <option value="1">Dinheiro</option>
    <option value="2">Cheque</option>
</select>

<label>Parcela 2</label>
<select name='parcela[]'>
    <option value="1">Dinheiro</option>
    <option value="2">Cheque</option>
</select>

Is it possible? Thank you in advance!

  • Hello Gisele! There are already similar questions and good answers. Look at the links I put on top. Good luck!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.