lokesh341 commited on
Commit
32a8151
·
verified ·
1 Parent(s): fc1bc87

Update templates/index.html

Browse files
Files changed (1) hide show
  1. 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
- const 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 removing spaces and handling @ properly
123
- const cleanedEmail = transcript.replace(/\s/g, '').replace(/\bat\b/g, '@'); // Replace "at" with "@"
 
 
 
 
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