2

I created a registration form with Google Forms. Now I would like to have an alert displayed before the submitter starts filling out data.

This is my code:

function onOpen() {
  FormApp.getUi()
      .createMenu('Custom Menu')
      .addItem('Show alert', 'showAlert')
      .addToUi();
}
function showAlert() {
  var ui = FormApp.getUi();
  var result = ui.alert(
     'Lorem ipsum',
     'dolor sit amet, consectetur adipiscing elit',
  ui.ButtonSet.OK);
}

The triggers were set up. The script works fine but only while a form is in in the editing mode, not in a view mode. Actually I'm the only one who can see the message box. It's not what I meant to ;-). How to show this alert to everyone who is going to fill out my form?

1

The Forms Service of Google Apps Scripts doesn't have methods for the respondent view. Actually, there isn't a Google Apps Script service or Google API to be used to extend the respondent view of Google Forms.

One alternative is to embed the Google Form in a web page or application that allow the use of alerts, i.e. Google Sites.

References

  • Does it mean that there is no way to show any alert or message box in respondent view? Do I have to use only text in the form itself if I want to communicate something to the submitter? – gordom Nov 19 '15 at 12:19
  • There are many ways to show an alert. Your question is about using certain code. Anyway, I added to my answer a hint about one alternative. – Rubén Nov 19 '15 at 12:45
  • As I know, Google Sites do not have preset alerts – Max Makhrov Jan 4 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.