required oninvalid="setCustomValidity('Please enter the product name');" oninput="setCustomValidity('');"
Use the above code in the form element. The id of the
form form is goodsForm
goodsForm.submit If used normally in Firefox, it will not be submitted if it is empty. If it is filled in correctly, it will be submitted. If Chrome prompts that it is not empty, it will still be submitted.
Please answer, thank you
If it is judged to be empty and is not submitted, then add return false;