I'm having a relatively simple problem, but I can not find a quick solution: I have a dropdownlist
that determines which div will be displayed, and the moment the page loads for the first time, it works perfectly. Shortly after saving the data (ie refresh on the page), the option that was hidden before this refresh is no longer displayed when selected in dropdownlist
.
The function below is called by selecting dropdownlist
. Right below, the% of% where I call the function.
I have tried using jQuery, I have already tried calling the event in the PostBack of the page (and outside it too), but the impression is that my div is lost sometime.
I've also tried putting dropdownlist
straight into div , without success. The two divs are set to display:none/block
, and are not done dynamically.
OBS. 2: Within .aspx
, there are two divParcelaVariavel
, used on two buttons.
function MudarEstado() {
var fixas = document.getElementById('ContentPlaceHolder2_divParcelaFixas');
var variaveis = document.getElementById('ContentPlaceHolder2_divParcelaVariavel');
if (document.getElementById('ContentPlaceHolder2_dropTipoParcelas').value == 'V') {
variaveis.style.display = 'block'
fixas.style.display = 'none'
}
else {
variaveis.style.display = 'none'
fixas.style.display = 'block'
}
}