Home > front end >  Js, how to realize the form validation by delay after a few seconds and then jump to the specified p
Js, how to realize the form validation by delay after a few seconds and then jump to the specified p

Time:10-06

Js, how to realize the form validation after a successful submit again after a few seconds later and jump, delay function what are fixed, but after clicking the submit button still jump immediately after successful authentication, please answer

CodePudding user response:

After the success of the validation, the jump is written on the inside setTimeout function

CodePudding user response:

reference 1st floor JiexC0la response:
after the success of the validation, jump is written in the setTimeout function inside the

Specific points,??????? I also checked a lot of methods, but it doesn't work

CodePudding user response:

reference 1st floor JiexC0la response:
after the success of the validation, jump is written in the setTimeout function inside the

I the delay function is written in the setInterval

CodePudding user response:

reference 1st floor JiexC0la response:
after the success of the validation, jump is written in the setTimeout function inside the

By the way, the test I use jquery in written form form the submit function,

CodePudding user response:

The browser or by itself safety problems are not allowed to let the program automatically submit, request,
You can try to execute a regularly submit, that is, perform cliack events regularly,

CodePudding user response:

reference qq_45868390 reply: 3/f
Quote: refer to 1st floor JiexC0la response:
after the success of the validation, jump is written in the setTimeout function inside the

I the delay function is written in the setInterval
delay jumps the code can be glued out look, I personally think after clicking the submit button, delay jump, setTimeout (function () {jump xx}, 3000); Should not immediately trigger, mobile code word is difficult, forgive me

CodePudding user response:

 
Document. GetElementById (" id "form). The onsubmit=function () {
//form validation code
Var that=this;
SetTimeout (function () {
That. Submit ();
}, 3000);
return false;
}

CodePudding user response:

refer to 7th floor sky waves reply:
 
Document. GetElementById (" id "form). The onsubmit=function () {
//form validation code
Var that=this;
SetTimeout (function () {
That. Submit ();
}, 3000);
return false;
}

OK, I try, should be