Fomr
Fomr
Fomr
<div class="auth-page-content">
<div class="container">
<div class="row justify-content-center mt-5">
<div class="col-md-7 col-lg-5 col-xl-4">
<div class="card mt-3">
<div class="card-body p-5">
<div class="text-center">
<div style="margin-bottom: 2.6rem">
<img src="~/assets/images/logos/logo-
dark.svg" alt="" width="110">
</div>
</div>
<div class="mt-4">
<form class="frm-login">
<div class="mb-4">
<input type="text" class="form-control"
name="f_login_username" placeholder="Usuario o correo electrónico" maxlength="120"
tabindex="1" autofocus="" autocomplete="off">
</div>
<div class="mb-4">
<div class="position-relative auth-
pass-inputgroup mb-3">
<input type="password" class="form-
control pe-5" name="f_login_password" placeholder="Contraseña" tabindex="2"
autocomplete="off">
<button class="btn btn-link
position-absolute end-0 top-0 text-decoration-none text-muted password-addon"
type="button"><i class="ri-eye-fill align-middle"></i></button>
</div>
</div>
<div class="mt-3">
<button class="btn btn-primary w-100
btn-load btn-login" type="button" tabindex="3">Iniciar sesión</button>
</div>
$('.' + remplace).empty().html(data.view).ready(function () {
processformuser = 1;
validateForms();
$('select[name="frm_user_reference"]').prop('disabled', true);
});
});
$('select[name="frm_user_search"]').change(function () {
$('select[name="frm_user_reference"]').removeClass('s2company
s2seller');
if (this.value) {
$('select[name="frm_user_reference"]').prop('disabled', false);
let option = $('select[name="frm_user_search"]
option:selected').data('int1');
let valMapping = {
2: { class: 's2company', placeholder: 'Seleccionar empresa...',
val: 10 },
3: { class: 's2seller', placeholder: 'Seleccionar vendedor...',
val: 30 }
};
} else {
$('select[name="frm_user_reference"]').empty().prop('disabled',
true);
});
$('select[name="frm_user_reference"]').change(function () {
if (this.value) {
$('input[name="frm_user_names"]').val($
('select[name="frm_user_search"] option:selected').data('int1') == 2 ? $
('select[name="frm_user_reference"] option:selected').data('text3') : $
('select[name="frm_user_reference"] option:selected').text());
$('input[name="frm_user_email"]').val($
('select[name="frm_user_reference"] option:selected').data('text4'));
$('input[name="frm_user_names"]').valid(); $
('input[name="frm_user_email"]').valid();
}
else {
$('input[name="frm_user_names"],
input[name="frm_user_email"]').val('');
}
$(this).valid();
});
$('select[name="frm_user_role"]').change(function () {
if (this.value) {
$('select[name="frm_user_reference"]').rules("add", {
required: true
});
} else {
$('select[name="frm_user_reference"]').rules("remove",
"required");
}
$('select[name="frm_user_reference"]').valid();
$(this).valid();
}
});
if ($('select[name="frm_user_search"]').val() != '') {
switch (option) {
case 2:
partialView('/webui/configuration/companies/companies-
form', {})
.then(function (data) {
bodyGenericFormCompany(data, 'modal-body-s');
})
.catch(function (error) {
console.log('Error:', error);
});
break;
case 3:
partialView('/webui/configuration/sellers/sellers-form',
{})
.then(function (data) {
bodyGenericFormSeller(data, 'modal-body-s');
})
.catch(function (error) {
console.log('Error:', error);
});
break;
}
e.preventDefault();
}
});
});