写 Google 表单提交前的动态内容

huangapple go评论75阅读模式
英文:

Write Google Form Dynamic Content Before Submitting

问题

我一直在尝试寻找这个答案,感觉一直在碰壁,但无法突破。

我正在为一个非营利组织建立一个Google表单。其中的一部分涉及填写多个字段,您可以同意捐款给不同的基金。我想要动态计算这些捐款字段的总额,并在用户提交表单之前显示给他们。

我似乎找不到在AppScript表单API中触发字段的onChange事件并获取这些值(或将它们写回到屏幕上)的方法。

有趣的是,有一个第三方插件,我可以支付费用来实现这个功能。我想,如果其他人能够使用第三方代码来实现这个功能,为什么我不能呢?

我只是无法弄清楚他们是如何做到的。

我已经探索了App Script API并查阅了很多以前的问题。似乎没有一个完全符合这个问题。

英文:

I've been trying to search for this answer and I feel like I keep bumping up against it but can't break through.

I'm building a Google Form for a non-profit. Part of it involves filling out multiple fields where you can agree to a donation to separate funds. I would like to dynamically total those donations fields and display the total for the end user before they submit the form.

I can't seem to find a way in the AppScript Form API to trigger onChange of a field and get at those values (or how to write them back to the screen).

Interestingly, there is a 3rd party plugin that I can pay for that does it. I figured if someone else is able to do it with 3rd party code, why can't I?

I just can't figure out how they're doing it.

I've explored the App Script API and dug through a lot of previous questions. Nothing quite seems to hit this one.

答案1

得分: 1

Google Forms API 仅处理表单的创建或在提交表单后发生的情况。您无法进行动态更改,如实时计算,或使用先前问题中输入的信息来提供新输入并在用户视图中显示它们。

我尝试过使用 Formfacade,似乎它是在 HTML 中的一个独立环境中运行;我猜想定制字段映射到目标表单的问题,但总体来说,您所“看到”的是它们的视觉环境,因此它不一定使用 Forms API,而是使用了他们的自定义库。然而,在 Google Forms 中能够处理动态答案的能力将是一个不错的功能。如果您有时间,可以提出一个功能请求

参考文献:

英文:

The Google Forms API only handles the creation of forms or what happens after submitting a form. You can’t make dynamic changes like live calculations, or using information entered on previous questions to feed new inputs and display them in the user’s view.

I played around with Formfacade, and it seemed to me that it operates from a separate environment in HTML; my guess is that the customized fields are mapped to the questions of the target form but that overall what you see is their visual environment, so it is not necessarily using the Forms API but a custom library for their service. Nevertheless, having the ability to work with dynamic answers in Google Forms would be a nice feature to have. If you have the time, you can open a Feature request

References:

huangapple
  • 本文由 发表于 2023年6月12日 21:42:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76457268.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定