title: how to combine google app script processForm, withSuccessHandler and withUserObject
body: <p>So I'm following the documentation here:</p>
  
  <p><a href="https://developers.google.com/apps-script/html_service?hl=en#GoogleScriptAPI" rel="nofollow noreferrer">https://developers.google.com/apps-script/html_service?hl=en#GoogleScriptAPI</a></p>
  
  <p>and it seems like I should be able to use processForm, withSuccessHandler and withUserObject in the same place, but I can't get it to work at the moment.  Here's one attempt</p>
  
  <pre><code>&lt;input name='submission'&gt;
  &lt;input type='hidden' name='match' value ='&lt;?= match?&gt;'&gt;
  &lt;input type='hidden' name='week' value ='&lt;?= j?&gt;'&gt;
  &lt;input type='hidden' name='assignment' value ='&lt;?= i?&gt;'&gt;
  &lt;input id='button' type='button' onclick='google.script.run.processForm(this.parentNode).withSuccessHandler(submissionReceived).withUserObject(this).getCurrentDate()'&gt;
  </code></pre>
  
  <p>but this gives me the following error when the button is clicked:</p>
  
  <p>Cannot read property 'withSuccessHandler_m___' of undefined </p>
  
  <p>The following does work:</p>
  
  <p><code>google.script.run.withSuccessHandler(submissionReceived).processForm(this.parentNode)</code></p>
  
  <p>however I want the "submissionReceived" function to receive the local object so that I can make some local changes to reflect the fact that this particular button (of many) has been clicked.  Basically this ordering:</p>
  
  <p><code>google.script.run.processForm(this.parentNode).withSuccessHandler(submissionReceived)</code></p>
  
  <p>fails with the same "Cannot read property 'withSuccessHandler_m___' of undefined " error, whether or not I am trying to pass an object to submissionReceived</p>
  
  <p>The following will run:</p>
  
  <p><code>google.script.run.withSuccessHandler(submissionReceived).withUserObject(this).processForm(this.parentNode)</code></p>
  
  <p>but the single parameter that gets passed to submissionReceived is undefined</p>
  
  <p>Any ideas about how to combine these three functions successfully in order to pass objects to the client side javascript functions on button clicks?</p>