Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8175673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:51:38+00:00 2026-06-06T22:51:38+00:00

I’am very new to google-apps-script. I encounter this error TypeError: Cannot find function getValue

  • 0

I’am very new to google-apps-script. I encounter this error “TypeError: Cannot find function getValue in object Generic” that i can’t figure out why.

Here is the code :

function doGet(e) {


  var app = UiApp.createApplication();
  app.setTitle("My first application");

  var vPanel = app.createVerticalPanel();

  var hPanel3 = app.createHorizontalPanel();
  hPanel3.add(app.createLabel("Text"));
  var textArea = app.createTextArea().setId('theText').setName('theText');
  //textArea.setName("textArea");

  hPanel3.add(textArea);
  vPanel.add(hPanel3);

  var hPanel4 = app.createHorizontalPanel();
  var button = app.createButton("Save");
  var handler = app.createServerHandler('onClick');
  handler.addCallbackElement(textArea);
  button.addClickHandler(handler);
  hPanel4.add(button);
  vPanel.add(hPanel4);

  var label = app.createLabel().setId('label').setText('tata');
  //label.setName("label");

  var hPanel5 = app.createHorizontalPanel();
  hPanel5.add(label);
  vPanel.add(hPanel5);

  app.add(vPanel);

  return app;

}

function onClick(e) {
  var app = UiApp.getActiveApplication();
  // ERROR occurs here when the button is clicked
  var text = app.getElementById('theText').getValue();

  Logger.log(text);

  app.getElementById('label').setValue(e.parameter.textArea + ' toto');
  //label.setText(textArea.getValue());

  return app;
}

I’ve already change the name and id of the textArea but nothing works.

Thanks for your help!

Trung

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:51:40+00:00Added an answer on June 6, 2026 at 10:51 pm

    The TextArea class has no the getValue method. Its value is passed to a handler as a parameter. Here is a sample demonstrating how it works.

    function doGet(e) {
       var app = UiApp.createApplication();
       var panel = app.createFlexTable();
       panel.setWidth('100%');
       var btn = app.createButton().setId('btn').setText('Click Me');
       var textArea = app.createTextArea().setName('textArea').setValue('Text');
       var handler = app.createServerHandler('onBtnClick');
       handler.addCallbackElement(panel);
       btn.addClickHandler(handler);   
       panel.setWidget(0, 0, btn);
       panel.setWidget(1, 0, textArea);
       app.add(panel);
       return app;
    }
    
    function onBtnClick(e) {
      var app = UiApp.getActiveApplication();
      var btn = app.getElementById('btn');
      var textAreaValue = e.parameter.textArea;
      btn.setText(textAreaValue);
      return app;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want use html5's new tag to play a wav file (currently only supported
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.