I have a problem to update the values on the fields of a form. I cannot update the date in its respective text box and the spreadsheet that receives the values only shows the values after i refresh the page (both Ui and spreadsheet are embbeded in the Google Sites)
The var date, explicited as a global var
var date=new Date();
The TextBox
var DataTextBox=app.createTextBox().setId('Data').setName('Data').setValue(date).setReadOnly(true).setText(Utilities.formatDate(date, 'GMT -02:00', 'dd/MM/yyyy HH:mm:ss'))
The handler
var clickHandler2=app.createServerHandler('updateAll');
button.addClickHandler(clickHandler2);
clickHandler2.addCallbackElement(panel);
The function (have others fields updated, but they are working fine)
function updateAll(e) {
//DataTextBox.setValue(date).setReadOnly(true).setText(Utilities.formatDate(date, 'GMT -02:00', 'dd/MM/yyyy HH:mm:ss'));
var newDate=date;
app.getElementById("Data").setValue(newDate);
app.getElementById("TicketId").setValue("");
app.getElementById("TicketType").setValue(TicketTypeArray[0]);
app.getElementById("DemandedBy").setValue(DemandedByArray[0]);
app.getElementById("Analyst").setValue(AnalystArray[0]);
app.getElementById("Description").setValue("");
}
How do i update the date field and how can i make the spreadsheet shows the last data submited by the form?
var app = UiApp.getActiveApplication();
first. – Bryan P