Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stephenombuya/telephone-number-validator

A simple web application to validate U.S. telephone numbers, allowing a variety of standard formats. Built with HTML, CSS, and JavaScript, this project provides real-time validation for U.S. phone numbers, checking formats and ensuring the correct country code if specified.
https://github.com/stephenombuya/telephone-number-validator

css3 html5 javascript regular-expressions

Last synced: about 1 month ago
JSON representation

A simple web application to validate U.S. telephone numbers, allowing a variety of standard formats. Built with HTML, CSS, and JavaScript, this project provides real-time validation for U.S. phone numbers, checking formats and ensuring the correct country code if specified.

Awesome Lists containing this project

README

        

# **Telephone Number Validator**
A simple web application to validate U.S. telephone numbers, allowing a variety of standard formats. Built with HTML, CSS, and JavaScript, this project provides real-time validation for U.S. phone numbers, checking formats and ensuring the correct country code if specified.

### **Table of Contents**
- Features
- Technologies Used
- Setup
- Usage
- Project Structure
- License

### **Features**
- Validates multiple U.S. phone number formats
- Alerts user when no input is provided
- Clears validation results on button click
- Styles for valid and invalid phone numbers
- User-friendly interface with input, button, and results display

### **Technologies Used**
- **HTML5**: Structure of the web app.
- **CSS3**: Styling the layout and feedback messages.
- **JavaScript**: Logic to validate phone numbers and handle button actions.
- **Regular Expressions (RegEx)**: Pattern matching for U.S. phone number formats.

### **Setup**

1. Clone the repository:

```
git clone https://github.com/stephenombuya/Telephone-Number-Validator/tree/main
```

2. Navigate into the project directory:

```
cd telephone-number-validator
```

3. Open index.html in your preferred browser:

```
open index.html
```

- Or use a live server to view the application locally.

### **Usage**
- **Enter a phone number**: Type any U.S. phone number format into the input field.
- **Validate**: Click the Check button to validate the entered number.
- **Clear**: Click the Clear button to reset the input field and results.

### **Project Structure**

```
telephone-number-validator/

├── index.html # Main HTML file
├── style.css # Main CSS file
├── script.js # JavaScript validation logic
└── README.md # Project documentation
```

### **License**
This project is licensed under the GNU GPL License. See the [LICENSE](https://github.com/stephenombuya/Telephone-Number-Validator/blob/main/LICENSE) file for details.