Can you help me, because I'm "breaking head" days:
I'm trying to get the date with document.getElementById
, but just in this field Nothing happens! It will be because of the calendar ...
function escrever(el) {
var isso = document.getElementById('calendSemana').value = el.value;
//var dias_semana = new Array("Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado");
//var data = new Date();
//var dia = data.getDay();
//document.write(dias_semana[dia]);
//linhasOcultas = (dias_semana[dia]);
//document.getElementById("#calendSemana").value(linhasOcultas);
//var campoValor = document.getElementById("celular").value;
//document.write(linhasOcultas);
//document.getElementById('calendSemana').value += campoValor;
//document.write("<input type='text' class='inputcad' id='calendSemana' name='calendSemana' maxlength='10' value='"+isso+"'>");
//document.getElementById('#calendSemana').value = document.getElementById('#data_3').value;
//document.getElementById('calendSemana').innerHTML = el.value;
}
<script type="text/javascript">
function mostraDiv(valor) {
if(valor == "Terça")
{
document.getElementById("TER").style.display = "block";
document.getElementById("QUI").style.display = "none";
}
else if(valor == "Quinta")
{
document.getElementById("TER").style.display = "none";
document.getElementById("QUI").style.display = "block";
}
else if(valor == "Selecione")
{
document.getElementById("TER").style.display = "none";
document.getElementById("QUI").style.display = "none";
}
}
</script>
<select name='dia' id='dia' class='inputselec' onchange='mostraDiv(this.value)'>
<option value="<? echo $_SESSION['dia_c']; ?>"><? if(empty($_SESSION['dia_c'])) { echo "Selecione"; } else { echo $_SESSION['dia_c']; } ?></option>
<option value='Terça'>Terça-feira</option>
<option value='Quinta'>Quinta-feira</option>
</select>
<div id='TER' style='display:none'>
<select name='terca' id='terca' class='inputselec'>
<option value="<? echo $_SESSION['terca_c']; ?>"><? if(empty($_SESSION['terca_c'])) { echo "Horário"; } else { echo $_SESSION['terca_c']; } ?></option>
<option value='14:30'>14:30</option>
<option value='14:50'>14:50</option>
<option value='15:10'>15:10</option>
<option value='15:30'>15:30</option>
<option value='15:40'>15:40</option>
</select>
</div>
<div id='QUI' style='display:<? echo $mostraQ ?>'>
<select name='quinta' class='inputselec'>
<option value="<? echo $_SESSION['quinta_c']; ?>"><? if(empty($_SESSION['quinta_c'])) { echo "Horário"; } else { echo $_SESSION['quinta_c']; } ?></option>
<option value='09:40'>09:40</option>
<option value='10:10'>10:10</option>
<option value='10:30'>10:30</option>
<option value='10:50'>10:50</option>
<option value='11:10'>11:10</option>
</select>
</div>
Thank you very much to anyone who can help me ... Light and Peace!