Google apps script ui enable button only when all values in grid are int -


i have google apps script application written using ui service (not html service), , app embedded in google site.

i have grid of 15 values (3x5). able use clienthandler validate the values in each textbox integers.

i want ensure 15 of values correctly set before enabling submit button.

what best way this?

obviously, toggling the button .setenabled property onchange no good, if 1 widget disables button, next valid integer, re-enable button.

i thought using serverhandler, figured slow , unreliable. i'd keep client side if can. feels should possible, can't work out. missing?

all advice welcomed. thanks.

this enable submit once fields integers, it'll need more added handle cases values changed non-integer after first passing validation.

function doget() {   var app = uiapp.createapplication();   var field1 = app.createtextbox();   var field2 = app.createtextbox();   var field3 = app.createtextbox();   var submit = app.createbutton('submit').setenabled(false);    var handler = app.createclienthandler().validateinteger(field1)   .validateinteger(field2).validateinteger(field3)   .fortargets(submit).setenabled(true);    field1.addvaluechangehandler(handler);   field2.addvaluechangehandler(handler);   field3.addvaluechangehandler(handler);    app.add(field1).add(field2).add(field3).add(submit);   return app; } 

deployed app.

corey's uiapp posts helpful in area.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -