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

  • Home
  • SEARCH
  • 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 8502201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:25:07+00:00 2026-06-11T01:25:07+00:00

The sbutton below should get enabled when the value of the datebox has been

  • 0

The sbutton below should get enabled when the value of the datebox has been changed. Why does it not work?

var sbutton = app.createButton('Set Alert').setId('sbutton').setPixelSize(250,    25).setEnabled(true);

// Button to be enabled only after date is set
var buttonenabler = app.createClientHandler().forTargets(sbutton).setEnabled(true);
eventdt.addValueChangeHandler(buttonenabler);

Check the code here https://script.google.com/d/1H6DLb8L6Qd3g55Dzn_A7ed61QvM_OcrLINDfya1i1h7JAyV_jLH7nmcq/edit

  • 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-11T01:25:08+00:00Added an answer on June 11, 2026 at 1:25 am

    Initially, during the creation, your button is already enabled (var sbutton = app.createButton('Set Alert')....setEnabled(true);), i.e. even if the handler is executed, the button will stay enabled. A simple demo showing how to enable a disabled button on a date box control value changing is following.

    function doGet(e) {
      var app = UiApp.createApplication();
      var date = app.createDateBox();
      var btn = app.createButton('Test').setEnabled(false);
      var handler = app.createClientHandler().forTargets(btn).setEnabled(true);
      date.addValueChangeHandler(handler);
      app.add(date);
      app.add(btn);
      return app;
    }
    

    Update: I reviewed your code. Seems it is a bug in GAS. The problem appears when the setFormat function call is added to the DateBox object. See the following code reproducing the issue. If to change value in the 1st date box then the 1st button is enabled. If to change the value of the 2nd date box, the 2nd button is not enabled. the difference is only in the setFormat call. A bug is submitted to the issue tracker and as a workaround you can to comment the setFormat calls in your code.

    function doGet(e) {
      var app = UiApp.createApplication();
      var date = app.createDateBox();
      var dateBug = app.createDateBox().setFormat(UiApp.DateTimeFormat.DATE_TIME_MEDIUM);
      var btn = app.createButton('Test').setEnabled(false);
      var btnBug = app.createButton('Test Bug').setEnabled(false);
      var handler = app.createClientHandler().forTargets(btn).setEnabled(true);
      var handlerBug = app.createClientHandler().forTargets(btnBug).setEnabled(true);
      date.addValueChangeHandler(handler);
      dateBug.addValueChangeHandler(handlerBug);
      app.add(date);
      app.add(btn);
      app.add(dateBug);
      app.add(btnBug);
      return app;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

after updating to Tapestry 5.3.2, my @ActivationRequestParameter does not work anymore .. having a
Could someone help me figure out how to get the hslide value in Flash
I need to toggle an element ONLY if it is not disabled. jQuery(#sbutton).toggle( function
I have the following html code : <div class=submit><input type=button name=getResult value=Get Comments class=sbutton
I have not completly understood how custom components work... Let's assume I have my
I'm a newbie to flex and am building a flex 4.5 app that has
I have a ListView that has a Button in the item template. Is there
I created a seam application using seam-gen. I am getting below error while navigating
I'm not getting any errors when I run the following files, but the data
Please, can anyone help me out on this : the piece of code below

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.