Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +7 -3
templates/index.html
CHANGED
@@ -115,12 +115,16 @@
|
|
115 |
status.textContent = "Listening for your email...";
|
116 |
recognition.start();
|
117 |
recognition.onresult = function(event) {
|
118 |
-
|
119 |
|
120 |
// If name is captured, we now capture email
|
121 |
if (isNameCaptured && !isEmailCaptured) {
|
122 |
-
// Correct email input format by
|
123 |
-
|
|
|
|
|
|
|
|
|
124 |
emailInput.value = cleanedEmail; // Set the email field with cleaned input
|
125 |
status.textContent = 'Registration complete.';
|
126 |
|
|
|
115 |
status.textContent = "Listening for your email...";
|
116 |
recognition.start();
|
117 |
recognition.onresult = function(event) {
|
118 |
+
let transcript = event.results[0][0].transcript.trim();
|
119 |
|
120 |
// If name is captured, we now capture email
|
121 |
if (isNameCaptured && !isEmailCaptured) {
|
122 |
+
// Correct email input format by replacing 'at' with '@'
|
123 |
+
transcript = transcript.replace(/\bat\b/g, '@').trim(); // Replace "at" with "@"
|
124 |
+
|
125 |
+
// Remove any spaces around the email input
|
126 |
+
const cleanedEmail = transcript.replace(/\s+/g, ''); // Remove any additional spaces
|
127 |
+
|
128 |
emailInput.value = cleanedEmail; // Set the email field with cleaned input
|
129 |
status.textContent = 'Registration complete.';
|
130 |
|