0
In my system, there are three types of users:
- General Manager;
- administrator; and
- Client.
The Client does not have access to the system, therefore, it does not need password and would not be required your email (since it would not login).
I wish that when the General Manager would choose between Client or Administrator, when selecting Administrator, a input
to enter your password, and add the required
to the input email; and when selecting Customer, was undone.
I was able to do the show and hide part input, but would like to know how to add the required to e-mail.
$("#tipo").change(function() {
$('#senha').hide();
if (this.value == "Administrador")
$('#senha').show();
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select name="tipo" id="tipo">
<option value="Cliente">Cliente</option>
<option value="Administrador">Administrador</option>
</select>
<input type="email" name="email" placeholder="E-mail">
<input required="" type="password" name="senha" id="senha" style="display:none;" placeholder="Senha">
$('[name="email"]').prop('required', true);
– Valdeir Psr