this is not working: <body> <script type="text/javascript">var submitted=false</script>…
- User
this is not working:
- Assistant
It seems there are a couple of issues with the code you provided.
Firstly, the HTML code is incomplete as it is missing the closing
</body>and</html>tags. Make sure to include them at the end of your code.Secondly, within the
onloadattribute of the<iframe>tag, you have a JavaScript code snippet that checks the value of thesubmittedvariable. However, there is no code provided that sets the value of this variable totrueor initiates the submission process.To make this code work, you need to add the necessary JavaScript code to set
submittedto true when the form is submitted. Here's an example:<body> <script type="text/javascript"> var submitted = false; function submitForm() { // Your form submission logic here submitted = true; } </script> <iframe name="hiddenConfirm" id="hiddenConfirm" style="display:none;" onload="if(submitted) { window.location='Submission confirmation.html'; }"></iframe> <!-- Your form goes here --> <form action="your-action" onsubmit="submitForm()"> <!-- form fields --> <button type="submit">Submit</button> </form> </body> </html> - User
- Assistant
There is still an issue with the code you provided. You are missing the closing
</script>tag and the closing quotes for theonloadattribute in the<iframe>tag. Here's the corrected code:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> /* Styles here */ </style> </head> <body> <script type="text/javascript"> var submitted = false; </script> <iframe name="hiddenConfirm" id="hiddenConfirm" style="display:none;" onload="if(submitted){window.location='Submission confirmation.html';}"></iframe> <div class="contact-form"> <div class="title">New Student?</div> <div class="sub-heading">Fill out the form below to get started.</div> <form action="https://docs.google.com/forms/d/e/1FAIpQLSdulEqtCuMT7McbUXdqGkkYYJqeLmoKdMG5yM8DhUHLS_F-yg/formResponse" method="post" target="hiddenConfirm" onsubmit="submitted=true"> <!-- Form fields --> </form> </div> <script type="text/javascript"> // Additional JavaScript code if needed </script> </body> </html>Make sure to replace the comment with the necessary input fields of your form.