Theory? Upload a File on a Google Form - google-apps-script

I am a newbie but have read on this site and others that
1. Google Forms cannot handle File uploads
2. For file uploads, you need a custom HTML form published as a webapp.
But the webapp can only be embedded in a Google Site and not a Google Form.
Can someone explain to me why Google Forms cannot handle file uploads? Why can't a file upload action be triggered by a form event such as filling out a text field with a file name? Or why can't a button on the form launch a custom form that has a file upload button?
Why can't HTML or a Webapp be imbedded within a Google Form? Is it possible to view the source code for a Google Form? I only see the WYSIWYG UI for creating forms and I have seen the scripting in the results spreadsheet of a form only.
Finally:
3. THe education version of Google has a file upload feature on their Forms. How can I get a copy of their source code to study how they did it?
As a last resort, I figured out that a hyperlink to a webapp can be added to a Google Form simply by typing the URL. How do I give the hyperlink a friendlier title like "Click here to upload a file" ?
Thanks in advance for your help!

Related

How to generate an HTML view in App Script from a Google Sheet

I have a client that uses Google forms to take orders and wants to be able to turn the resulting Sheet into a document of Packing Slips. Being a python person I am currently taking her .tsv and making nice HTML printable docs but want to be able to make a plug-in for her so that on any Sheet of this type she can click "Make Packing Slips" and it either opens a new tab with generated HTML (I'm ok using googles templating) or maybe even convert the HTML into a PDF and save it to her drive? Either way I'd rather design the document all in HTML and CSS rather than trying to make a google doc if at all possible. Is the feasible? Any starting points? Thanks!
You need to learn about Google App Script => https://developers.google.com/apps-script/overview
Then these Links should suffice
HTML Service: Create and Serve HTML
Google Container-bound Scripts for Google App Script (Can not post link for this due to low reputation)

Dynamic behavior in Google forms using AppsScript

I am creating a Google forms page which ends with a file upload button. This file upload button should get enabled once the above existing form items like check box, text field, etc are validated. How can this be achieved using AppsScript in Google Forms? I couldn't file any resource that shows how to validate fields in a form.
The live form can only be static. You can not cause the layout or elements of the live form to change. You can only make changes to the master form and republish the live form.
There is built in validation with forms:
https://support.google.com/docs/answer/3378864?hl=en

How do I use placeholder in Google Forms?

I have created a contact page using Google Forms. And I want to add a placeholder in this forms.
Before asking, I searched a lot on Google but I get no success. The only way I am able to do is by accessing Developer Tools in Chrome Browser by assigning placeholder="some_name" but that is of no use as it is for temporary basis.
How do I achieve this?
You can't add a placeholder to a field in a Google Form.
There is no way to dynamically change the HTML, CSS and JavaScript in a Google Form. The Google Form is served directly from Google's servers. There is no way to add and save HTML, CSS and JavaScript to the Form file. If you try to open a Form file from Drive, there is only one option to open it with Google Forms. You can't open a Google Form with a code editor, and you can't download it. There is no way to run JavaScript code when the Form is first loaded.
I had the same problem. You can't add placeholders directly, but you may find this workaround useful. Go to:
(Old forms) "Responses->Get pre-filled URL"
(New froms) "More->Get pre-filled link"
Fill in the fields with values you need and click "Submit". You will get the link to the prefilled form with entered values in the fields

How to embed google form which is created using script

I have created a form using script in google now i want to add this in my website and want to share the form. I don't know how to do that?? So if anyone knows how to do that please let me know i need it very urgently..
Go into the Form Editor, open File menu, select "Embed...", and use the "Embed Form" dialog to generate the HTML for an iframe you can embed in your web site.

Google App Script: Run script from within another script?

I am working on a payroll web app for my company. I was wondering if there is anyway to run a script from within another script. Such as having a hyperlink or something similar that the user could go and see a different UI and everything. If this is not possible, does anyone knows how to submit a copy of a html form to an email? I been trying to do this but GAS removes the styles and the JavaScript code that fills the form before sending it. I just need at least an image of the form so the manager could print it out and sign it.
Thanks
Yes, you can link from one script to another using regular anchors.
It's not Apps Script stripping your emailed form of this stuff. Email clients, including Gmail, intentionally don't support complex HTML. If you want an image, try creating a Google Doc with the DocumentsApp, converting it to pdf with document.getAs("application/pdf") and then emailing that.