How do I use placeholder in Google Forms? - html

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

Related

Theory? Upload a File on a Google Form

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!

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

Display custom message after submitting a Google Form

I have a Google Form that allows user to enter their information. After they submit the form, the data is inserted to a Google spreadsheet as a new row.
However I want to show a dynamic message right after the form is submitted, overriding the original "thank you" message. The new message would display the information they just filled in, with an number assigned to him.
For example, Mary filled in her data and submit the form. Since Mary is the 5th person to submit this form, the message shows her number as 5.
Is there any way to achieve this? I have been studying Google App Script and HTML service but I am not sure if this is the correct way.
Please note that we have already using email to send out this message for several years however user strongly suggest that showing their ID right after form submission would make lots of things much easier.
Thank you very much!
Update
I have been working on it and now I am able to make a web page that inserts a new row to a spreadsheet. But another question: How to publish the web page? When I open the "/dev" link it works fine; However when I open the "/exec" link it says cannot find "Index.html" and I am sure there is a file called Index.html.
There is no way to add a custom confirmation message for the current user of the currently open Form. You can run code to change the confirmation message when the Form is submitted, but changing the confirmation message when the Form is submitted won't take affect until the NEXT Form is opened, and that's too late. So the next person to open the Form would get the confirmation message of the previous user.
You would need to convert everything to a stand alone HTML App for something like that.
Google just released a new version of Google Forms. In the settings you can change the confirmation page message for respondents. You can save a link to a web page in the custom message. So if you can create a web page with the data you want displayed, you should be able to save the link in the custom message.
In order to achieve the above-mentioned goal, you need to get the Google form on your web page. No, I am not talking about embedding the form to your web page but to create a stand alone HTML page. The reason behind doing so is since Google is a third party website, editing any code in Google forms is not possible and there is no other way (at least I could not figure out Yet) to place custom thank you page URL for the Google Form. You can even remove certain codes in your HTML page to make sure it doesn't look like or says Google form. Basically, to have custom URL you need to replace
Code to be replaced for custom Thank you url in Google form
In case you are not a techie, Playing with codes might break the code.This step by step blog for customising Google form might help you.

How to embed Google Compose Mail window in to Google Sheet Form?

I won't bore everyone reading this post with the entire background story of why I need to do this. However, I am looking to load the Google Compose Mail page in the HTML form loaded inside a Google Sheet I have created.
I know the link for the Compose email is https://mail.google.com/mail/u/0/?view=cm&fs=1&tf=1&to=TO&su=SUBJECT&body=BODY
But I don't know if it is possible to have this link loaded as a view in the HTML service Form.
Does anyone know if this is possible and if so, how to do it?
I could always have a button to load the link in a separate tab... but I would like to have this all kept on screen to be more "professional" looking.
I was looking for an option to add an iframe or free code, but option exists. I recommend inserting a form if you are looking for a way to get data from users.
Its under "Insert", then "Form..."
Good Luck

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.