2
I have several fields and others in display:none
(In advance I notice that I have walked in the stack and I even found a similar question but I could not have the expected result.)
I need to validate them, but I need to enable a Ubmit button, my code is not inside a form, this is what has damaged.
My code below:
<style>
#btn_Codigo,
#btn_Nome,
#btn_Sexo{
display: none;
}
</style>
<div class="upage vertical-col left hidden" id="parte01">
<ion-header-bar class="bar inner-element uib_w_1 bar-positive bar-header" data-uib="ionic/header" data-ver="0">
<div class="buttons widget-container content-area horiz-area wrapping-col"></div>
<h1 class="title">Cadastro de Tratamento</h1>
<div class="buttons widget-container content-area horiz-area wrapping-col">
<div class="button-bar widget uib_w_16 d-margins" data-uib="ionic/button_bar" data-ver="0"></div>
</div>
</ion-header-bar>
<div style="height: 45px;"></div>
<div class="tabs widget uib_w_18 ajusteMargin" data-uib="ionic/tab_bar" data-ver="0"><a class="tab-item widget uib_w_19" data-uib="ionic/tab_item" data-ver="0" id="btn_Pessoa">Pessoa</a><a class="tab-item widget uib_w_20" data-uib="ionic/tab_item" data-ver="0" id="btn_Consulta">Consulta</a><a class="tab-item widget uib_w_21"
data-uib="ionic/tab_item" data-ver="0" id="btn_Pagamento">Pagamento</a>
</div>
<label class="item item-input item-select widget uib_w_2 d-margins" data-uib="ionic/select" data-ver="0">
<div class="input-label">Estatus</div>
<select id="slc_Situacao">
<option>Ativo</option>
<option>Inativo</option>
</select>
</label>
<label class="item item-input widget uib_w_23 d-margins item-stacked-label" data-uib="ionic/input" data-ver="0"><span class="input-label">Ultimo levantamento</span>
<input type="date" id="dt_UltimoLevantamento">
</label>
<label class="item item-input widget uib_w_3 d-margins borderObrigatorio" data-uib="ionic/input" data-ver="0" id="txt_Cliente">
<i class="icon placeholder-icon ion-android-search ion"></i>
<input type="text" placeholder="Cliente">
</label>
<button class="button widget uib_w_4 d-margins button-small button-balanced ion ion-android-contact icon-only" data-uib="ionic/button" data-ver="0" id="btn_NovoCliente"></button>
<label class="item item-input widget uib_w_5 d-margins borderObrigatorio" data-uib="ionic/input" data-ver="0" id="btn_Codigo">
<input type="text" placeholder="Código">
</label>
<label class="item item-input widget uib_w_6 d-margins borderObrigatorio" data-uib="ionic/input" data-ver="0" id="btn_Nome">
<input type="text" placeholder="Nome">
</label>
<label class="item item-input item-select widget uib_w_7 d-margins" data-uib="ionic/select" data-ver="0" id="btn_Sexo">
<div class="input-label">Sexo</div>
<select id="btn_Sexo">
<option>Masculino</option>
<option>Feminino</option>
</select>
</label>
<button class="bar button inner-element widget uib_w_8 bar-footer fixedBot tom button-assertive ion ion-alert-circled" data-uib="ionic/button" data-ver="0" id="btn_Proximo1"></button>
</div>
When you click the button #btn_Pessoa
i give a .show()
in the fields to show it there it starts to be part of the requirements.
When all fields are correct I need to modify my button to the code below:
PREVIOUS:
<button class="bar button inner-element widget uib_w_8 bar-footer fixedBot tom button-assertive ion ion-alert-circled" data-uib="ionic/button" data-ver="0" id="btn_Proximo1"></button>
POSTERIOR:
<button class="bar button inner-element widget uib_w_8 bar-footer fixedBot tom button-balanced" data-uib="ionic/button" data-ver="0" id="btn_Proximo1">PRÓXIMO</button>
How to do all this ?
I’m doing HTML5, CSS, Jquery, I don’t have a backand, because the button just redirects to the next level of registration so to speak. Sincerely yours.
Can you review the question and explain what should be validated a little better? You want to validate what is inserted in the inputs and only then "go forward" and show other fields, that’s it?
– Sergio
@Sergio Actually I want the fields to be filled in, so I can go to the next step. I just need it to be filled in.
– Renan Rodrigues
Okay, and can this HTML be changed? You have repeated Ids and this makes it difficult for the selectors. Each
label
is a field to check and only then shows the nextlabel
?– Sergio
It can be changed yes the ID, exactly, should check each input, and only after checking the inputs of the page it can go to another.
– Renan Rodrigues
Can you explain how you want to go "to another page"? You wrote that you don’t have back-end... the data is sent where? how do you want to pass data from page to page?
– Sergio
@Sergio The data will not be sent anywhere, it is a school work, where I need to make an interface just to validate, it will not really save anywhere, however I need to validate, a validation in my case, would be the fields is filled, ie I can only go to another part of the registration if it is really identified that my screen fields are all filled, (mandatory fields).
– Renan Rodrigues