2
As I validate fields in CSHTML itself, when I click the button, it validates the fields and if there are fields not filled it remains on the page, displaying a message. See the example fields and button to validate.
<div class="form-group">
<div class="grid_4">
<label>Nome</label>
</div>
<div class="grid_14">
<input type="text" name="txtNome" class="grid_14 required" placeholder="Nome completo" required />
</div>
</div>
<div class="form-group">
<div class="grid_4">
<label>Email</label>
</div>
<div class="grid_7">
<input type="email" name="txtEmail" class="grid_6 required" placeholder="Email válido" required />
</div>
<div class="grid_2">
<label>CPF</label>
</div>
<div class="grid_5">
<input type="number" name="txtCpf" class="grid_5 required" placeholder="99999999999" required />
</div>
</div>
//Botão
<div class="grid_17">
<button value="novaPesquisa" class="btn-pular-passo pull-right">Continuar</button>
</div>
I tried so, but the Razor Helper doesn’t work. Do I need to add some using? Just one question. Shouldn’t the required lock if the field is empty? My button calling another page, for example, if you have empty field shouldn’t lock? And if the button just enables a div, which is my case, how would I lock?
– pnet