0
votes

https://docs.google.com/forms/d/e/1FAIpQLSe4-5jfzznYBB1UByawdNucFRls2Nt17MgT5K1w_ikKUrByVQ/viewform. This is link to my google form. When I inspect an input element, I can't find name attribute. I need name attribute so that I can store my HTML form data to google spreadsheet. The attribute must contain a value like "entry.***". When I inspect an input element, the following is displayed without any name attribute:

<input type="text" class="quantumWizTextinputPaperinputInput exportInput" jsname="YPqjbf" autocomplete="off" tabindex="0" aria-labelledby="i1" aria-describedby="i2 i3" dir="auto" data-initial-dir="auto" data-initial-value="">

Where to get the name attribute?

1

1 Answers

0
votes

Google Forms are dynamically generated

You won't be able to customise the attributes of the HTML elements here because it is dynamically generated. If you want to create a form and have more control over how it behaves and you want to retain integration with Google services, the best option is to use web apps.

Web Apps

This will allow you to customise the attributes of the elements as you will be writing your own HTML. For example, one of the most simple web apps looks like this:

function doGet(){

 var HTMLString = "<style> h1,p {font-family: 'Helvitica', 'Arial'}</style>"
 + "<h1>Hello World!</h1>"
 + "<p>Welcome to the Web App";

 HTMLOutput = HtmlService.createHtmlOutput(HTMLString);
 return HTMLOutput
}

More information about that is linked below. You could:

  • Create your Apps Script project
  • Write a version of the function above with an HTML form made to your linking. You can then assign an onSubmit event to the form which will trigger a function in the Apps Script to update your spreadsheet with its info. You can call an Apps Script function from your client-side HTML using a syntax like this:
google.script.run.testFunc()

More information about that here.

References