javascript - Keep getting NaN in Google Script while adding numbers -
i have gui designed using ui services in google apps script. has 2 text boxes entering numbers, named "number1" , "number2". when ever run app , enter 2 number in field , click button answer textbox says nan
, instead of showing answer expect. why?
here's of code, can find here.:
function doget() { var app = uiapp.createapplication(); app.add(app.loadcomponent("calcgui")); return app; } function buttonclicked(userinput) { var app = uiapp.getactiveapplication(); var = userinput.parameter.number1; var b = userinput.parameter.number2; var answer = parseint(a, 10) + parseint(b, 10); app.getelementbyid('answer').settext(answer); return app; }
thanks sharing
i solved issue on script. when using gui builder, need add callbackelement server handler. can done in gui interface shown in first image (see properties of + button, down list, near function name there little + can add relevant widget id or parent. in case choosed flowpanel contains widgets.
but in case i'd suggest switch uiapp these kind of app since gui builder not available soon.
Comments
Post a Comment