1
I need to get different text inputs, already tried and right for some, below a list of what worked.
lbl_DteHora_Reu
slc_Local_Reu
slc_Palavra_Reu
slc_QuebraGelo_Reu
slc_Louvor_Reu
HTML:
<label class="item item-input widget uib_w_60 d-margins ajustes" data-uib="ionic/input" data-ver="0" ><span class="input-label">Data e Hora</span>
<input type="datetime-local" id="lbl_DteHora_Reu">
</label>
<label class="item item-input item-select widget uib_w_67 d-margins" data-uib="ionic/select" data-ver="0">
<div class="input-label">Local</div>
<select id="slc_Local_Reu" class="slc_Reuniao">
<option value="SO" selected="">--</option>
<option value="OT">Outro</option>
</select>
</label>
<input id="lbl_Endereco_Reu" type="text" placeholder="Digite o outro endereço">
<label class="item item-input item-select widget uib_w_62 d-margins" data-uib="ionic/select" data-ver="0">
<div class="input-label">Palavra</div>
<select id="slc_Palavra_Reu" class="slc_Reuniao">
<option value="SO" selected="">--</option>
<option value="OT">Outro</option>
</select>
</label>
<input id="lbl_Palavra_Reu" type="text" placeholder="Digite outra pessoa para palavra">
<label class="item item-input item-select widget uib_w_63 d-margins" data-uib="ionic/select" data-ver="0">
<div class="input-label">Quebra Gelo</div>
<select id="slc_QuebraGelo_Reu" class="slc_Reuniao">
<option value="SO" selected="">--</option>
<option value="OT">Outro</option>
</select>
</label>
<input id="lbl_QuebraGelo_Reu" type="text" placeholder="Digite outra pessoa para o quebra gelo">
<label class="item item-input item-select widget uib_w_64 d-margins" data-uib="ionic/select" data-ver="0">
<div class="input-label">Louvor</div>
<select id="slc_Louvor_Reu" class="slc_Reuniao">
<option value="SO" selected="">--</option>
<option value="OT">Outro</option>
</select>
</label>
<input id="lbl_Louvor_Reu" type="text" placeholder="Digite outra pessoa para o louvor">
<label class="item item-input widget uib_w_65 d-margins ajustes_button" data-uib="ionic/textarea" data-ver="0">
<textarea id="txt_Observacoes_Reu" placeholder="Observação" rows="10" wrap="hard"></textarea>
</label>
Jquery:
/* button #btn_Salvar_Reuniao */
$(document).on("click", "#btn_Salvar_Reuniao", function(evt)
{
var dtHora = $("#lbl_DteHora_Reu").val();
var local = $("#slc_Local_Reu").val();
var local_outro = $("#lbl_Endereco_Reu").val();
var palavra = $("#slc_Palavra_Reu").val();
var palavra_outro = $("#lbl_Palavra_Reu").val();
var quebragelo = $("#slc_QuebraGelo_Reu").val();
var quebragelo_outro = $("#lbl_QuebraGelo_Reu").val();
var louvor = $("#slc_Louvor_Reu").val();
var louvor_outro = $("#lbl_Louvor_Reu").val();
var obs = $("textarea#txt_Observacoes_Reu").val();
console.log(dtHora+","+local+",",+local_outro+",",+palavra+",",+palavra_outro+",",+
quebragelo+",",+quebragelo_outro+",",+louvor+",",+louvor_outro+",",+ obs);
if (local == "SO" || local_outro == "" || palavra == "SO" || palavra_outro == "" || quebragelo == "SO" || quebragelo_outro == "" || louvor== "SO" || louvor_outro == ""){
alert("Não pode haver nenhum campo vazio");
}else{
alert("Pode cadastrar");
}
});
My idea is when click leave on select outro
it opens an input to be typed, it is working perfect until it is part, when I put a value in select it picks everything right, but when I leave in another it does not take the input data.
I made an example in the fiddle https://jsfiddle.net/#run&togetherjs=hpc2TmqAnv
The interesting thing is that when I select one of the other select options other than
outro
I take the correct value and the value of the fieldinput
regarding the same comes0
, but when I select another he informsNaN
the same problem happens in textarea, if it has no content it informs0
if add content it informsNaN
try this way: Document.getElementById("lbl_Endereco_Reu"). value
– Thiago Friedman
keeps giving the same problem, I’ve checked the ids, and they’re all correct
– Renan Rodrigues
from what I understood its problem is to take the value of the input field, so here it works http://jsfiddle.net/sL5n8nt9/1/
– Thiago Friedman
try this
var local_outro = $('#lbl_Endereco_Reu').prop('value');
– feresjorge
@Thiagofriedman Ok there is working but I have option to take the value of the inputs tbem
– Renan Rodrigues
@feresjorge when using what he suggested gave me the same problem, the exit was: 2015-09-07T04:52,39, 0, Nan, Nan, 1, 0, 1, 0, Nan [First two pros
NaN
the data entered wereoutro
andasdasda
] and for the latter was inserted in the textareaasd2wqada
.– Renan Rodrigues