Reputation: 71
I want to know whether its possible to display a dialog box popup after submitting google forms. Just before the screen in which a confirmation screen is displayed that your request has been recorded.
I checked this post in which onOpen event of spreadsheets is used to display a popup. How do I open a web browser using google apps script?.
Can i do the same onFormSubmit event of spreadsheet. If it's possible than how to do this because I am new to google app script. My requirement is to use fileUpload with google forms. After user submits the forms a dialog should appear asking user if he/she wants to upload a file. Thanks.
Upvotes: 4
Views: 13630
Reputation: 4160
Use Modal.
<!DOCTYPE html>
<html>
<title>W3.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<body>
<div class="w3-container">
<h2>W3.CSS Modal</h2>
<button onclick="document.getElementById('id01').style.display='block'" class="w3-button w3-black">Open Modal</button>
<div id="id01" class="w3-modal">
<div class="w3-modal-content">
<div class="w3-container">
<span onclick="document.getElementById('id01').style.display='none'" class="w3-button w3-display-topright">×</span>
<p>Some text. Some text. Some text.</p>
<p><a href="https://docs.google.com/forms/d/e/1FAIpQLSc5u-6VIwTFiiIWHZeHZhaYF12Mr-ca_oF57S31AxIqmquWWQ/viewform?usp=sf_link">Hi</a></p>
</div>
</div>
</div>
</div>
</body>
</html>
Upvotes: -2
Reputation: 2788
I've never found a way to cut in after the submit button is pressed, but before the confirmation page is displayed, but a workaround I've used is to add a link to text of the confirmation page (at the bottom of the edit view of the form) that can take you to a new webpage. This avoids having to go to the trouble of creating a custom form using GAS.
Upvotes: 0
Reputation: 173
Unfortunately you can't display a popup dialog box after submitting Google forms. To show a popup you must be with the spreadsheet opened.
If you want to customize the message to the user with a popup box you will have to built the form manually using HtmlService
Upvotes: 3