Write the code using JavaScript that validates if all the fields of the form are filled. (3) Submit the HTML code, JavaScript code and screenshot of the form opened in a browser window. You must demonstrate the form and validations at the time of viva
Here is a simple example of HTML and JavaScript code that validates if all the fields in a form are filled out before submission. If any of the fields are empty, an alert will appear prompting the user to fill out all the fields.
### HTML Code:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Validation</title>
<script src="script.js"></script>
</head>
<body>
<h2>Registration Form</h2>
<form id="registrationForm" onsubmit="return validateForm()">
<label for="firstName">First Name:</label><br>
<input type="text" id="firstName" name="firstName"><br><br>
<label for="lastName">Last Name:</label><br>
<input type="text" id="lastName" name="lastName"><br><br>
____ ________ _______ _________ _________ _______.
_____ ________ _____ _______ _________ _____ __________ ____.
_____ ___ _______ ___ ______ ____ _________ ____ ________ ____ ______ _________.
____ _______ ___ __________ ___ ________ ______ _________ ____ _______.
______ _____ ____ ______ ___ ____ _______ _______.
______ ____ _______ _______ ________ _____ ____ _________.
____ __________ ________ ___ _____ ____ ___.
__________ _________ _____ ______ _______ ________ _____ _______.
____ _____ ______ __________ ____ _____.
__________ ______ _____ _________ _______ ___ _______ _____ ________.
_______ _________ ______ _______ ___ ___ ________ ________.
___ _________ __________ ______ _____ ____ _______ _____ _______ ________ ________.
__________ ______ ________ _____ ______ ____ __________ ______ ________ ______ __________.
__________ _______ _______ ____ _____.
______ ______ ________ _____ ___.
____ ______ ____ _____ __________ ____ ______ _______ ___.
_____ _______ ________ __________ __________ ___ ____ _______ __________.
____ _____ ________ ______ _______ ________ _______ ________ ________ ________ __________ __________.
_______ __________ ____ ___ ___ ___.
______ _______ ____ ________ _____ ________ ____ ______ __________ ____ _________ _________.
___ ________ _______ ________ _____ ______ ___ ____ ________ ______.
___ _______ ____ ____ __________ ________ ______.
_________ _____ ______ __________ ________ ______ ________ _____ __________ ____.
________ _________ _____ ________ _________ __________ _____ ____ _______ ___ _______.
_________ ________ _______ _______ ____ ____ _________.
_______ ____ ____ ______ ________ _______ ______ _________ ___.
______ _______ _______ _________ __________ _______ __________ _______ ________ ____ ______ _____.
_____ _____ _______ _________ ___ ___ ________ _______ ______.
______ _______ _________ _____ __________ ______ ___ _________.
________ _____ _________ _____ _______ ____ ______ _____.
____ ___ _____ _________ ____ _________ _________ ________ ________.
___ ___ ______ ______ ____ _______ ____ _____ __________ ______ ______.
________ __________ _________ _____ _________.
____ ___ __________ ___ __________ __________ __________ ______ ___ _______.
_________ _______ _________ __________ ____ _______ __________ ___.
__________ ____ __________ ________ ________ _____ _____.
______ __________ _______ ____ ______ __________.
__________ ________ _________ ____ ________.
________ ________ _________ _____ ________.
_____ __________ ______ ___ _____ ____.
________ ____ ________ ________ _________ ____.
___ ____ _______ ____ ________ _______ ___ __________ ___ _____.
____ ____ _____ ________ ____ __________ ________ ____ ___ __________.
__________ ______ ______ _______ _____ ______ _______.
_______ _______ _______ ____ ____ _________ _______ ____.
______ _________ ___ ______ ___ ______ ______ ________ ________.
____ _________ ___ _____ ______.
_______ _____ ___ ________ _______ _______ ______ __________ _______ ___ _________ ____.
_____ _____ __________ ________ __________ _______ ______ ___.
______ ___ __________ __________ _________ ___ ___ __________ ___ __________.
__________ _________ ________ _________ __________.
_____ _____ _________ ____ __________ __________ ________.
____ ____ _____ ________ __________ _______ __________ ________ ___ _____ _____ ___.
_____ ___ _____ ____ ___.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
✓ Unlock up to 60% of the answer
✓ No payment required