I use google form in my website without iframe tag, so I didn't find how to write "thank you" and cancel going to the response page of google form.
This is the html code:
<form action="https://docs.google.com/forms/u/2/d/e/1FAIpQLSeBJHw1Q6YlwO_0s2OgMhuyQEj4PLvToM1N1G5BEYQRiZlCLQ/formResponse">
<label for="">It's FREE</label>
<input type="text" placeholder="Full Name" class="inputs" id="input1" name="entry.1045366435">
<input type="email" placeholder="Email" class="inputs" id="input2" name="entry.1398681060">
<textarea id="" cols="30" rows="10" placeholder="Message" name="entry.403219718"></textarea>
<input type="submit" id="submit" value="Send">
</form>
<script type="text/javascript" src="form.js"></script>
What do I need to write in the js file? Thank you very much a lot !
You can check if the form is submitted or not. The following code is used jQuery.
$('form').submit(function() { alert(1); // example code // add your code here });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <form action="https://docs.google.com/forms/u/2/d/e/1FAIpQLSeBJHw1Q6YlwO_0s2OgMhuyQEj4PLvToM1N1G5BEYQRiZlCLQ/formResponse"> <label for="">It's FREE</label> <input type="text" placeholder="Full Name" class="inputs" id="input1" name="entry.1045366435"> <input type="email" placeholder="Email" class="inputs" id="input2" name="entry.1398681060"> <textarea id="" cols="30" rows="10" placeholder="Message" name="entry.403219718"></textarea> <input type="submit" id="submit" value="Send"> </form>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.