I am trying to design a google form, when the specific value from the dropdown is selected I want to enable a new text box where the user can enter his answer. For example:
In the "Name"
field in Google form, there is a list of names, when a user does not find his name from the list he would select the option "don't see your name?"
from the list, then the text box would be enabled/appears to record his name. If any other option is selected then this text box should not appear. As it is shown in this image:
Note: I am updating the name list from google sheet Column A using the following code:
function populateGoogleForms() {
var form = FormApp.openById("###id");
var IdList = form.getItemById(form.getItems()[0].getId()).asListItem();
var ss = SpreadsheetApp.getActiveSheet();
var namesValues = ss.getRange(2, 1, ss.getLastRow() , 1).getValues();
// populate the drop-down with the array of data
IdList.setChoiceValues(namesValues);
}
please let me know if you have any suggestions. Thank you
CodePudding user response:
Put the name text box in a separate section, and use the "go to section" option to visit the section only when the user chooses the option that specifies that their name is not on the list. Otherwise, jump over the section. See Show questions based on answers.