Q:

Update/edit google sheets row values from html input

I have an html form where the client's data is inserted in and it appends row with the values on to a google sheet.
In the form, there's a field that searches and returns the clients data when searching for a specific value (id number).
function getID(IDsearch){
  var ws = SpreadsheetApp.getActiveSheet();
  var data = ws.getRange(3, 1, ws.getLastRow(), 36).getValues();

  var dataInput = data.map(function(r){return r[7];});  
  var position = dataInput.indexOf(IDsearch);
  var dataArray = ws.getRange(position+3, 1, 1, 36).getValues();

  if(position > -1){
    return dataArray;
  } else {
    return position;
  }

} 

After this runs, all the input fields in the form are populated with the data from that row. 
I need to edit the values in the form and when submit it should overwrite/update the existing row with that id number.
In google sheets documentation, I've found the spreadsheets.values.update method, but I cannot figure this out. I'm pretty new in this and any help would be appreciated. 
Thanks everyone!

A:

You want to achieve the following flow.

Input "ID" to id="insertID" and click "Search by ID".
Show the values from Spreadsheet by searching "ID".
Edit the values of id="name" and id="ID".
When "Save data" is clicked, you want to update the values on the Spreadsheet.

From your replying, shared Spreadsheet and script, I could understand like above. If my understanding is correct, how about ths following modification? Please think of this as just one of several possible answers.
Modification points:

In your case, processForm at Google Apps Script side is required to be modified.

Search the row using formObject and overwrite the values of cells.

Modified script:
When your script is modified, please modify processForm at Google Apps Script side as follows. I remove the Spreadsheet ID from the URL. So please set it, before you test the script.
function processForm(formObject) {
  var url = "https://docs.google.com/spreadsheets/d/###/edit#gid=0";
  var ss = SpreadsheetApp.openByUrl(url);
  var ws = ss.getSheetByName("Database");

  // I added and modified below script.
  var ranges = ws.getRange(4, 2, ws.getLastRow() - 3, 1).createTextFinder(formObject.ID).findAll();
  if (ranges.length > 0) {
    for (var i = 0; i < ranges.length; i++) {
      ranges[i].offset(0, -1, 1, 2).setValues([[formObject.name, formObject.ID]]);
    }
  } else {
    ws.appendRow([formObject.name, formObject.ID]);
  }
}

In this modification, when the same IDs are existing, all rows of the same IDs are overwritten. For example, if you want to modify the 1st one, please modify to ranges[0].offset(0, -1, 1, 2).setValues([[formObject.name, formObject.ID]]);.

Reference:

Class TextFinder

