New Text Document Reg
New Text Document Reg
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register - ABC Services</title>
<style>
/* Same styles as before */
body {
font-family: Arial, sans-serif;
background-color: #d1f2d1;
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
}
header {
background-color: #c8e6c9;
padding: 15px;
text-align: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
header h1 {
margin: 0;
font-size: 24px;
color: #2d3748;
}
.main-content {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}
.register-box {
background-color: #e6f5e6;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 400px;
}
.register-box h2 {
margin: 0 0 20px 0;
text-align: center;
color: #2d3748;
}
.role-selection {
margin-bottom: 20px;
display: flex;
gap: 20px;
justify-content: center;
}
.role-option {
display: flex;
align-items: center;
}
.role-option input[type="radio"] {
margin-right: 8px;
}
.role-option label {
font-size: 14px;
color: #4a5568;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
color: #4a5568;
font-size: 14px;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
width: 100%;
padding: 8px;
border: 1px solid #d1d5db;
border-radius: 4px;
box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
border-color: #3b82f6;
outline: none;
}
.mobile-number {
display: flex;
gap: 10px;
}
.mobile-number select {
width: 30%;
}
.mobile-number input {
width: 70%;
}
.show-password {
display: flex;
align-items: center;
margin-top: 5px;
font-size: 12px;
color: #666;
}
.show-password input[type="checkbox"] {
margin-right: 4px;
transform: scale(0.9);
}
.register-button,
.reset-button {
width: 48%;
padding: 10px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
.register-button {
background-color: #3b82f6;
color: white;
}
.register-button:hover {
background-color: #2563eb;
}
.reset-button {
background-color: #f8f9fa;
color: #4a5568;
border: 1px solid #d1d5db;
}
.reset-button:hover {
background-color: #e2e8f0;
}
.button-group {
display: flex;
justify-content: space-between;
margin-top: 20px;
}
.error-message {
color: #dc2626;
font-size: 12px;
margin-top: 5px;
display: none;
}
.success-message {
color: #16a34a;
font-size: 14px;
text-align: center;
margin-top: 20px;
}
.acknowledgment-screen {
display: none;
}
.preferences-group {
display: flex;
gap: 20px;
margin-bottom: 15px;
}
.preferences-group div {
display: flex;
align-items: center;
}
.preferences-group input[type="checkbox"] {
margin-right: 8px;
}
footer {
background-color: #c8e6c9;
padding: 15px;
text-align: center;
font-size: 12px;
color: #4a5568;
}
.login-link a {
color: #3b82f6;
text-decoration: none;
}
.login-link a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<header>
<h1>ABC Services Company</h1>
</header>
<div class="main-content">
<div class="register-box">
<h2>Register</h2>
<form id="registerForm">
<div class="role-selection">
<div class="role-option">
<input type="radio" id="customerRole" name="role"
value="customer" checked>
<label for="customerRole">Customer</label>
</div>
<div class="role-option">
<input type="radio" id="adminRole" name="role"
value="admin">
<label for="adminRole">Admin</label>
</div>
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" required>
<div id="emailError" class="error-message"></div>
</div>
<div class="form-group">
<label for="mobileNumber">Mobile Number</label>
<div class="mobile-number">
<select id="countryCode">
<option value="+1">+1 (USA)</option>
<option value="+91">+91 (India)</option>
<option value="+44">+44 (UK)</option>
</select>
<input type="text" id="mobileNumber" maxlength="10"
required>
</div>
<div id="mobileNumberError" class="error-message"></div>
</div>
<div class="form-group">
<label for="address">Address</label>
<textarea id="address" rows="3" required></textarea>
<div id="addressError" class="error-message"></div>
</div>
<div class="form-group">
<label for="confirmPassword">Confirm Password</label>
<input type="password" id="confirmPassword" maxlength="30"
required>
<div id="confirmPasswordError" class="error-message"></div>
</div>
<footer>
<p>Helpline: +1 123 456 7890 • Address: 123 Green Street, Eco City,
Earth</p>
<p>© 2025 ABC Services. All rights reserved.</p>
</footer>
<script>
// Show/hide password functionality
document.getElementById('showPassword').addEventListener('change',
function() {
const passwordInput = document.getElementById('password');
const confirmPasswordInput =
document.getElementById('confirmPassword');
passwordInput.type = this.checked ? 'text' : 'password';
confirmPasswordInput.type = this.checked ? 'text' : 'password';
});
// Validate Email
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
document.getElementById('emailError').textContent = 'Invalid email
format';
document.getElementById('emailError').style.display = 'block';
hasError = true;
}
// Validate Address
if (address.trim() === '') {
document.getElementById('addressError').textContent = 'Address is
required';
document.getElementById('addressError').style.display = 'block';
hasError = true;
}
// Validate Password
const hasUpperCase = /[A-Z]/.test(password);
const hasLowerCase = /[a-z]/.test(password);
const hasSpecialChar = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]
+/.test(password);
// Reset form
document.getElementById('registerForm').addEventListener('reset',
function() {
document.querySelectorAll('.error-message').forEach(el => {
el.style.display = 'none';
});
});
</script>
</body>
</html>