What are the js issues on the login interface? 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?
Reply to discussion (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.
Write verification in check ().
Write a function in js for verification and pass it to php.
Return false in check;
Return false ??
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?
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?
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.
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?
If there are many inputs, each event can have an onkeypress event. Therefore, it is better to return an onsubmit event and false is enough.
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?
If there are many inputs, each event can have an onkeypress event. Therefore, it is better to return an onsubmit event and false is enough.
Education