Hello! I am using a javascript code to change the values of some text fields everytime the user choose a value on a dropdown list at a submission form. This is the code: <SCRIPT LANGUAGE="JavaScript"> function atualizacampos() { var text1 = document.getElementById('InsertRecordEntidades_Canais_Info_1'); var text2 = document.getElementById('InsertRecordEntidades_Canais_Info_2'); var text3 = document.getElementById('InsertRecordEntidades_Canais_Info_3'); var text4 = document.getElementById('InsertRecordEntidades_Canais_Info_4'); var dropC = document.getElementById('InsertRecordEntidades_Canais_ID_Canal_Doacao'); var Cselecionado = dropC.options[dropC.selectedIndex].text; switch(Cselecionado) { case 'Depósito Bancário': text1.value='Agência' break; case 'Nota Fiscal': text1.value='Número da Nota'; break; case 'Paypal': text1.value='Código Paypal'; break; default: } } document.getElementById('InsertRecordEntidades_Canais_ID_Canal_Doacao').onchange=atualizacampos; </SCRIPT> This is already working, but right now i am trying to change also the labels of those text fields. I already tried some sibblings options, but it did not work. Can you guys please tell me the correct code to achieve that? So everytime a user change the dropdown value, the text1.value will be changed and also the label associated with this field will be changed for a new value.
Can someone please help?
My best regards, Shidartha