Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validate() {
- let form = document.querySelector("form");
- Array.from(form.elements).forEach((input) => {
- if( input.value == "" ){
- alert(`${input.name} needs to be entered.`);
- return false;
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement