The problem I have is that I want an update to be made when I modify two fields of the text box type for it. I have a function that takes both IDs and when I detect the change, call a function:
$(document).ready(function miFuncion() {
let status_usuario = false;
let status_correo = false;
function _sumbitForm() {
if ( status_correo==true && status_usuario==true)
{
alert('Formulario usuario con correo!');
$("#actualizar").prop("method", "post");
}
if ( status_correo==false && status_usuario==true )
{
alert('Actualizar usuario');
$("#actualizar").prop("method", "post");
$("#emailA").prop("name", "emailNo");
}
if (status_correo==true && status_usuario==false )
{
//alert('Formulario Enviado!');
$("#actualizar").prop("method", "post");
$("#usuario").prop("name", "usuarioNo");
}
$('#usuario , #emailA').change(function() {
status_correo=true;
status_usuario = true;
_sumbitForm();
});
$('#usuario').change(function() {
status_usuario = true;
_sumbitForm();
});
$('#emailA').change(function() {
status_correo = true;
_sumbitForm();
});
}
The bad thing is that I always take the first conditioner of the changes osea
this:
$('#usuario , #emailA').change(function() {
status_correo=true;
status_usuario = true;
_sumbitForm();
});
On the one hand, it is fine when both the user and the email are modified in the same registry but if only the user or the email is modified it keeps on leading me to that same change when I want Go to the respective change where only the user or email is modified
I would like to know if there is a way to alter this
$('#usuario , #emailA').change(function() {
Since I guess you are taking me if there is a change in user or email enter the function when I want to say if there is a change in user and email that enters
I guess this statement should be different:
$('#usuario , #emailA')
Please urgently help I can not get out of this problem.
Thanks for the help Diego Dam event onchange
to the text boxes?
I do not understand what you mean.
I always get into the first condition of change
$('#usuario, #emailA').change(function() {
status_correo=true;
status_usuario = true;
_sumbitForm();
});
What I want is that if only one parameter is changed I enter the other conditioner, for example, user when making a change only in the user, take me this one.
$('#usuario').change(function() {
status_usuario = true;
_sumbitForm();
});
Just enter the condition mentioned above $('#usuario , #emailA').change(function() {
, please help.