Spaces:
Sleeping
Sleeping
File size: 8,757 Bytes
c024705 c1ce623 c024705 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Input Functionality</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
<style>
body {
background-color: #f8f9fa;
padding: 20px;
}
.test-container {
max-width: 800px;
margin: 0 auto;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.form-control {
background-color: #fff !important;
color: #497060 !important;
border: 1px solid #ced4da !important;
}
.form-control:focus {
border-color: #7c3aed !important;
box-shadow: 0 0 0 0.2rem rgba(124, 58, 237, 0.25) !important;
}
</style>
</head>
<body>
<div class="test-container">
<h2>Test Input Functionality</h2>
<p>This page tests if the input fields are working properly. Try typing in each field below:</p>
<form id="testForm">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="test_username">Username *</label>
<input type="text" class="form-control" id="test_username" name="username" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="test_password">Password *</label>
<input type="password" class="form-control" id="test_password" name="password" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="test_first_name">First Name *</label>
<input type="text" class="form-control" id="test_first_name" name="first_name" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="test_last_name">Last Name *</label>
<input type="text" class="form-control" id="test_last_name" name="last_name" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="test_email">Email *</label>
<input type="email" class="form-control" id="test_email" name="email" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="test_phone">Phone</label>
<input type="tel" class="form-control" id="test_phone" name="phone">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="test_specialization">Specialization *</label>
<select class="form-control" id="test_specialization" name="specialization" required>
<option value="">Select Specialization</option>
<option value="psychiatrist">Psychiatrist</option>
<option value="psychologist">Psychologist</option>
<option value="counselor">Counselor</option>
<option value="social_worker">Social Worker</option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="test_experience">Experience (Years)</label>
<input type="number" class="form-control" id="test_experience" name="experience_years" min="0" value="0">
</div>
</div>
</div>
<div class="form-group">
<label for="test_bio">Bio</label>
<textarea class="form-control" id="test_bio" name="bio" rows="3" placeholder="Brief professional background..."></textarea>
</div>
<div class="form-group">
<label>Expertise Areas *</label>
<div class="row">
<div class="col-md-6">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="expertise" value="depression" id="test_expertise_depression">
<label class="form-check-label" for="test_expertise_depression">Depression</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="expertise" value="anxiety" id="test_expertise_anxiety">
<label class="form-check-label" for="test_expertise_anxiety">Anxiety</label>
</div>
</div>
<div class="col-md-6">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="expertise" value="ptsd" id="test_expertise_ptsd">
<label class="form-check-label" for="test_expertise_ptsd">PTSD</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" name="expertise" value="trauma" id="test_expertise_trauma">
<label class="form-check-label" for="test_expertise_trauma">Trauma</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Test Submit</button>
<button type="button" class="btn btn-secondary" onclick="clearForm()">Clear Form</button>
<button type="button" class="btn btn-info" onclick="debugForm()">Debug Form</button>
</div>
</form>
<div id="debugOutput" style="margin-top: 20px; padding: 10px; background-color: #f8f9fa; border-radius: 4px; display: none;">
<h5>Debug Output:</h5>
<pre id="debugContent"></pre>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Test form functionality
document.getElementById('testForm').addEventListener('submit', function(e) {
e.preventDefault();
alert('Form submitted successfully! All inputs are working.');
});
function clearForm() {
document.getElementById('testForm').reset();
document.getElementById('debugOutput').style.display = 'none';
}
function debugForm() {
const form = document.getElementById('testForm');
const inputs = form.querySelectorAll('input, select, textarea');
const debugInfo = [];
inputs.forEach((input, index) => {
debugInfo.push(`Input ${index}: ${input.type || 'select'} - ${input.name} - Value: "${input.value}" - Disabled: ${input.disabled} - ReadOnly: ${input.readOnly}`);
});
document.getElementById('debugContent').textContent = debugInfo.join('\n');
document.getElementById('debugOutput').style.display = 'block';
}
// Test input functionality
document.addEventListener('DOMContentLoaded', function() {
const inputs = document.querySelectorAll('input, select, textarea');
inputs.forEach(input => {
input.addEventListener('input', function() {
console.log(`Input changed: ${this.name} = "${this.value}"`);
});
input.addEventListener('focus', function() {
console.log(`Input focused: ${this.name}`);
});
});
});
</script>
</body>
</html>
|