Skip to content

Mesh-code1/javascript_client-side_form-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Assignment Title: Hands-on Exercise: Basic Form Validation Using JavaScript

Objective:

The purpose of this assignment is to provide students with practical experience in implementing basic form validation using JavaScript. Students will learn how to ensure that user inputs meet specified criteria before form submission.

Assignment Overview:

In this hands-on exercise, students will create a simple web form and implement client-side validation using JavaScript. The form should include various input types, such as text fields, email, password, and select/dropdown menus. The validation script should check for correct input formats, required fields, and any other specified conditions before allowing the form to be submitted.

Requirements:

Create a registration and login form

Registration Form Structure:

Form Fields: Name (text field) Email (email field) Password (password field) Confirm Password (password field) Age (number field) Gender (radio buttons) Country (select/dropdown menu) Terms and Conditions (checkbox) Submit Button: A button to submit the form.

Login Form Structure:

Form Fields: Email (email field) Password (password field) Login Button.

JavaScript Validation:

Required Fields: Ensure that all fields marked as required are not empty. Email Validation: Check that the email address is in the correct format (e.g., user@example.com). Password Validation: Ensure the password is at least 8 characters long. Ensure that the "Confirm Password" field matches the "Password" field. Number Validation: Ensure the age entered is a valid number and falls within a reasonable range (e.g., 18-100). Checkbox Validation: Ensure that the "Terms and Conditions" checkbox is checked before form submission. Error Messages: Display clear and concise error messages near the relevant fields if validation fails.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published