4

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.

Rubén
  • 34,714
  • 9
  • 70
  • 166
Nishant
  • 71
  • 1
  • 2
  • 6
  • I need a submission confirmation popup on google form. I have customers who accidently press submit. I want google to give me confirmation popup saying 'are you sure, you want to submit your response'. If i select 'No' then nothing should get submitted and i'm back on the form. How do i do this.? – smaqsood May 30 '21 at 22:34

3 Answers3

3

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

  • Thanks for reply.. So is there any other way of adding the file upload functionality to google forms.. – Nishant May 27 '14 at 04:56
  • You can't add file upload to google forms. Again, HtmlService is the way to go for this matter! – Rafael De Alemar Vidal May 27 '14 at 13:32
  • Ok i created custom form with app script with the file upload. User accessing it can fill the form and upload the file as well. File will be stored to my drive. But now i can't find a solution for embedding that script in my application. I am using SAPUI5 as front end. Published url is like this. https://script.google.com/macros/s/......./exec. Is there any way to do this. – Nishant May 28 '14 at 05:00
  • One of the limitations of GAS apps (gadgets) is you can only embed them in a Google site, not your own webpage. https://code.google.com/p/google-apps-script-issues/issues/detail?id=852 – Andrew Roberts May 28 '14 at 08:16
0

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.

Andrew Roberts
  • 2,720
  • 1
  • 14
  • 26
  • Can you please explain me where you added that button/link and how to add it. Because i can't find it. – Nishant May 28 '14 at 10:04
  • Open your form in GDrive and you should see it in "edit view". At the bottom of the page is the text and options for the confirmation page: see this [example image](https://drive.google.com/file/d/0BxRtIprIrwuzTWJod29EWk80YkU/edit?usp=sharing) – Andrew Roberts May 29 '14 at 06:08
  • Your method is good and is almost similar what i want. But my link is a published GAS link. https://script.google.com/macros/s/...../exec But i want to write upload files which should be a clickable link.. So how can i hide a link behind some name. – Nishant May 29 '14 at 07:06
  • I don't think you can do that, but you could try experimenting with markdown or html tags. When I did it, the URL just automatically turned into a link. You could shorten it with something like bit.ly – Andrew Roberts May 29 '14 at 20:04
-2

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">&times;</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>
Mohammad Shahid Siddiqui
  • 3,730
  • 2
  • 27
  • 12