I have this question, there are 2 fields that need to be linked, leave the code:
<span>Номер отделения</span> <input type="text" required size="90px" id="departament" oninput="input()"> <span>Адрес отделения</span> <input type="text" required size="90px" id="address" disabled> the task is, a person writes in the field "branch number", for example, branch number 1, the address of this branch is entered in the "address of branch" field immediately. that is, let's say there are 5 branches, and each has its own address, the "branch address" field is not editable, the address is automatically driven in, I tried to do with oninput, but something did not go in, it was said that the branch number and address is taken from the array , and substituted, tell me the solutions, perhaps through a cycle of how to substitute, thanks
var dep_address=new Array(); dep_address[0]=1; dep_address[1]="address 1 departament"; dep_address[2]=2; dep_address[3]="address 2 departament"; dep_address[4]=3; dep_address[5]="address 3 departament"; dep_address[6]=4; dep_address[7]="address 4 departament"; dep_address[8]=5; dep_address[9]="address 5 departament";