Creating the Order form
In the Code.gs
file, define the following global variables:
// Replace with your spreadsheet's ID. var ss = SpreadsheetApp .openById("spreadsheet's id"); var SheetOrders = ss.getSheetByName("Orders"); var SheetStock = ss.getSheetByName("Stock");
Create the doGet
function:
function doGet(){ var template = HtmlService.createTemplateFromFile("Order"); var html = template.evaluate(); return HtmlService.createHtmlOutput(html); }
The preceding function returns the Order
form from the Order.html
template. Create a new HTML file named Order
and enter the following code in it:
<!-- Order.html --> <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <form> <table> <tr> <td><label>Select Item:</label></td> <td> <select> <option value="Item 1">Item 1</option> <option...