3

I have a form that I have implemented using HtmlService. When I submit it I want to see different Html page instead of the page with the form on it. Basically this new page should replace the form page. How do I go about doing this. I tried to create a template form from the process form function that gets called when the form is submitted. But it didn't work. Help me out with this please.

Rijo Simon
  • 777
  • 3
  • 15
  • 35

3 Answers3

1

See this answer for an example of serving multiple html pages using HtmlService. The basic idea is to write doGet() to accept a query parameter that it will use to select which html page to serve.

Community
  • 1
  • 1
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
0

I am not aware of any server-side redirect mechanism (that you could use in the template, that is). However, one way how to do it is via Ajax, client-side. See, for example, how I did it in VALET (open index.html and look from line 240 on).

As an aside: I also tried reloading a page which seemed not to work (maybe due to the restrictions re the window and document object.

Community
  • 1
  • 1
Michael Hausenblas
  • 13,162
  • 4
  • 52
  • 66
0

You can use doPost() with HTML Services to load another html page.

See this answer.

Community
  • 1
  • 1
jmeich
  • 885
  • 1
  • 7
  • 8