Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Editable form fields? Reply To: Editable form fields?

#171316
chrisburton
Participant

So I keep getting the following error

Uncaught ReferenceError: client is not defined

$('textarea').blur(function(){

  var request;

  request = $.ajax({
    type: "POST",
    dataType: "json",
    async: true,
    data: {
      id: client.id,
      name: client.name,
      address: client.address,
      phone: client.phone,
      day: client.day,
      paid: client.paid,
      owe: client.owe,
      completed: client.completed
    }
  });

  request.done(function(customer) {
    return console.log(customer);
  });

  request.fail(function(jqXHR, textStatus) {
    console.log(jqXHR);
    return console.log(textStatus);
  });

});

I know we’ve touched on this being a solution but I’m not really understanding this script. Wouldn’t I need to POST to the session and then update the database with the new session data? This doesn’t seem like it does that but rather posts data to a URL (which I stripped from the script).