Skip to content

Instantly share code, notes, and snippets.

@scottswaaley
Created August 3, 2016 17:14
Show Gist options
  • Save scottswaaley/d9a258ab80180e12ab3cd6e0f562cda2 to your computer and use it in GitHub Desktop.
Save scottswaaley/d9a258ab80180e12ab3cd6e0f562cda2 to your computer and use it in GitHub Desktop.
function doGet() {
var app = UiApp.createApplication();
var formPanel = app.createFormPanel();
var verticalPanel = app.createVerticalPanel();
var label1 = app.createLabel("Enter a thing here: ");
var textBox1 = app.createTextBox().setName('textBoxResult1');
var label2 = app.createLabel("Enter a feeling here: ");
var textBox2 = app.createTextBox().setName('textBoxResult2');
var submitButton = app.createSubmitButton("Click to submit");
verticalPanel.add(label1).add(textBox1).add(label2).add(textBox2).add(submitButton);
formPanel.add(verticalPanel);
app.add(formPanel);
return app;
}
function doPost(e) {
var app = UiApp.getActiveApplication();
var label1 = app.createLabel("I love to eat " + e.parameter.textBoxResult1 + " on tuesdays.");
var label2 = app.createLabel("It makes me feel " + e.parameter.textBoxResult2 + ".");
app.add(label1).add(label2);
return app;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment