Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +29 -1
templates/index.html
CHANGED
@@ -207,7 +207,35 @@
|
|
207 |
speak("You said " + document.getElementById('mobile').value + ". Is this correct?", confirmMobile);
|
208 |
};
|
209 |
}
|
210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
function confirmMobile() {
|
212 |
recognition.start();
|
213 |
recognition.onresult = function(event) {
|
|
|
207 |
speak("You said " + document.getElementById('mobile').value + ". Is this correct?", confirmMobile);
|
208 |
};
|
209 |
}
|
210 |
+
function autoConfirm() {
|
211 |
+
document.getElementById('confirmName').textContent = document.getElementById('name').value;
|
212 |
+
document.getElementById('confirmEmail').textContent = document.getElementById('email').value;
|
213 |
+
document.getElementById('confirmPhone').textContent = document.getElementById('mobile').value;
|
214 |
+
document.getElementById('confirmation').style.display = 'block';
|
215 |
+
setTimeout(autoSubmit, 3000);
|
216 |
+
}
|
217 |
+
function autoSubmit() {
|
218 |
+
var name = document.getElementById('name').value;
|
219 |
+
var email = document.getElementById('email').value;
|
220 |
+
var phone = document.getElementById('mobile').value;
|
221 |
+
fetch('/submit', {
|
222 |
+
method: 'POST',
|
223 |
+
headers: { 'Content-Type': 'application/json' },
|
224 |
+
body: JSON.stringify({ name: name, email: email, phone: phone })
|
225 |
+
})
|
226 |
+
.then(response => response.json())
|
227 |
+
.then(data => {
|
228 |
+
if (data.success) {
|
229 |
+
document.getElementById('status').textContent = 'Your details were submitted successfully!';
|
230 |
+
document.getElementById('confirmation').style.display = 'none';
|
231 |
+
speak("Your registration is complete. Thank you for registering.");
|
232 |
+
setTimeout(() => location.reload(), 5000);
|
233 |
+
} else {
|
234 |
+
document.getElementById('status').textContent = 'There was an error submitting your details.';
|
235 |
+
speak("There was an error submitting your details. Please try again.");
|
236 |
+
}
|
237 |
+
});
|
238 |
+
}
|
239 |
function confirmMobile() {
|
240 |
recognition.start();
|
241 |
recognition.onresult = function(event) {
|