I need to get different input text, I have already tried and right for some, below a list of those that 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 to click to leave in the select outro
it open an input to be typed, it is working perfect until it is part, when I put a value in the select it picks everything right, but when I leave in another it does not get the input data.
I made an example in fiddle link
The interesting thing is that when I select one of the other options of the select other than
outro
I get the correct value and the value of theinput
field is0
, but when I select another it it saysNaN
% the same problem happens in textarea, if it does not have content it informs0
if it adds content it informsNaN