block the form but won't show which fields are actually empty
one way i thought out to find(":invalid") elements on submit button click, but since button click is handled by js to find and validate field that keeps submit from firing
thought out when (:invalid).length === 0 and then i submit the form, is there any better approach to handle this?
add novalidate attribute to form and use JavaScript for form validation
well instead of hooking on button.onclick, you can hook on forb,onsubmit, and event.preventDefault() to have your custom logic on submitting the form
Обсуждают сегодня