mirror of
https://github.com/DeNNiiInc/Advanced-Smtp-Tester.git
synced 2026-04-17 17:35:59 +00:00
Feat: Auto-trim whitespace from input fields on blur
This commit is contained in:
@@ -239,6 +239,19 @@ function displayErrorWithTips(errorMessage, container) {
|
|||||||
container.innerHTML = errorMessage + tipsHTML;
|
container.innerHTML = errorMessage + tipsHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===================================
|
||||||
|
// AUTO-TRIM INPUT FIELDS
|
||||||
|
// ===================================
|
||||||
|
// Automatically trim whitespace from all text inputs on blur
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const textInputs = document.querySelectorAll('input[type="text"], input[type="email"], input[type="password"]');
|
||||||
|
textInputs.forEach(input => {
|
||||||
|
input.addEventListener('blur', function() {
|
||||||
|
this.value = this.value.trim();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// ===================================
|
// ===================================
|
||||||
// PASSWORD TOGGLE
|
// PASSWORD TOGGLE
|
||||||
// ===================================
|
// ===================================
|
||||||
|
|||||||
Reference in New Issue
Block a user