What are the js issues on the login interface? Log on to the system in the background. if the form does not meet js requirements, the js prompts an error. if it is correct, go to php login data verification. as a result, I made a form and did not fill in anything, js must prompt an error, but jump to the php page immediately. I just don't know how to block the js issue of f login interface when js verification fails?
Log on to the background system. if the form does not meet js requirements, the js prompts an error. if it is correct, go to php login data verification,
As a result, I made a form without filling anything. js must prompt an error, but I will jump directly to the php page.
I just don't know how to block form action submission when js verification fails?
----------------------------
I used onsubmit,
But I don't know how to do it? Share:
------ Solution --------------------
Do not use onsubmit events
Write a button as needed. when you click it, the system will detect that the system is qualified. if $ ("form"). submit () is unqualified, the system will prompt that the system is unqualified.
------ Solution --------------------
Write verification in check ().
------ Solution --------------------
Write a function in js for verification and pass it to php.
------ Solution --------------------
Return false in check;
------ Solution --------------------
Return false ??
------ Solution --------------------
Reference:
Do not use onsubmit events
Write a button as needed. when you click it, the system will detect that the system is qualified. if $ ("form"). submit () is unqualified, the system will prompt that the system is unqualified.
What if I press enter to submit?
------ Solution --------------------
Reference:
Quote: reference:
Do not use onsubmit events
Write a button as needed. when you click it, the system will detect that the system is qualified. if $ ("form"). submit () is unqualified, the system will prompt that the system is unqualified.
What if I press enter to submit?
Can I add a detection button to the input in the form to submit if I press enter?
------ Solution --------------------
Write the verification method in the check () event of JS.
For example
Function check (){
If (account = ''){
Alert ("account cannot be blank ");
Return false;
}
Return true;
}
If the verification fails, return false is required. if not, the form will be submitted.
Return true can be used or not.
------ Solution --------------------
Reference: