How can I get the value of a dropdownlist box and assigne to a hidden textbox in javaScript function?

I was looking to get a selected value from a dropdownlist box and assigne it to a hidden text.here is the line code of code in my javascript function but it return the value 'undifined'.

document.Form1.elements['cPIsNameHidden'].value = document.Form1.elements['cPIs'].selectedIndex.value;

Thank you in advance.




Answer this question

How can I get the value of a dropdownlist box and assigne to a hidden textbox in javaScript function?

  • Sayan Ghosh

    Here is the solution from yassin abdi

    document.getElementById("cPIsNameHidden").value = document.getElementById("cPIs").value

    Tnx Yas!

    Ephi



  • How can I get the value of a dropdownlist box and assigne to a hidden textbox in javaScript function?