For some reason, the dialog box currently works with only one list. The rest of the lists are ignored and do not want to appear in the specified cells. I tried to solve the problem in various ways and none helped.
Code gs
<code>function openInputDialog() {
var html = HtmlService.createHtmlOutputFromFile('Index3').setSandboxMode(HtmlService.SandboxMode.IFRAME);
.showModalDialog(html, 'Заполни форму');
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
sheet.appendRow([" ", form.category, form.item, form.manupub, form.details, form.quantity]);
<code>function openInputDialog() {
var html = HtmlService.createHtmlOutputFromFile('Index3').setSandboxMode(HtmlService.SandboxMode.IFRAME);
SpreadsheetApp.getUi()
.showModalDialog(html, 'Заполни форму');
}
function itemAdd(form) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
sheet.appendRow([" ", form.category, form.item, form.manupub, form.details, form.quantity]);
return true;
}
</code>
function openInputDialog() {
var html = HtmlService.createHtmlOutputFromFile('Index3').setSandboxMode(HtmlService.SandboxMode.IFRAME);
SpreadsheetApp.getUi()
.showModalDialog(html, 'Заполни форму');
}
function itemAdd(form) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
sheet.appendRow([" ", form.category, form.item, form.manupub, form.details, form.quantity]);
return true;
}
HTML file
<form id="myForm" onsubmit="handleFormSubmit(this)">
<label for="specify the date in the format: xx.xx.xxxx">Specify the date in the format: xx.xx.xxxx</label>
<input type="text" name="category"><br><br>
<label for="the nickname of the conductor">The nickname of the conductor:</label>
<input type="text" name="item"><br><br>
<label for="choice">Сhoice:</label>
<select id="choice" name="choice">
<option value="Option1">Option1</option>
<option value="Option2">Option2</option>
<label for="choice2">Choice2:</label>
<select id="choice2" name="choice2">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
<label for="choice3">Choice3:</label>
<select id="choice3" name="choice3">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
<input type="button" value="Finish"
onclick="google.script.run
.withSuccessHandler(google.script.host.close)
.itemAdd(this.parentNode)" />
<code><!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<form id="myForm" onsubmit="handleFormSubmit(this)">
<label for="specify the date in the format: xx.xx.xxxx">Specify the date in the format: xx.xx.xxxx</label>
<input type="text" name="category"><br><br>
<label for="the nickname of the conductor">The nickname of the conductor:</label>
<input type="text" name="item"><br><br>
<label for="choice">Сhoice:</label>
<select id="choice" name="choice">
<option value="Option1">Option1</option>
<option value="Option2">Option2</option>
</select><br><br>
<label for="choice2">Choice2:</label>
<select id="choice2" name="choice2">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
</select><br><br>
<label for="choice3">Choice3:</label>
<select id="choice3" name="choice3">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
</select><br><br>
<input type="button" value="Finish"
onclick="google.script.run
.withSuccessHandler(google.script.host.close)
.itemAdd(this.parentNode)" />
</form>
</body>
</html>
</code>
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<form id="myForm" onsubmit="handleFormSubmit(this)">
<label for="specify the date in the format: xx.xx.xxxx">Specify the date in the format: xx.xx.xxxx</label>
<input type="text" name="category"><br><br>
<label for="the nickname of the conductor">The nickname of the conductor:</label>
<input type="text" name="item"><br><br>
<label for="choice">Сhoice:</label>
<select id="choice" name="choice">
<option value="Option1">Option1</option>
<option value="Option2">Option2</option>
</select><br><br>
<label for="choice2">Choice2:</label>
<select id="choice2" name="choice2">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
</select><br><br>
<label for="choice3">Choice3:</label>
<select id="choice3" name="choice3">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
</select><br><br>
<input type="button" value="Finish"
onclick="google.script.run
.withSuccessHandler(google.script.host.close)
.itemAdd(this.parentNode)" />
</form>
</body>
</html>
I tried to rewrite the HTML, but it didn’t solve the problem. I have checked many forums, but I have not found a solution to this problem. I hope for your help, because there is still a lot I don’t understand in Apps script.