title: MeteorJS AutoForm.Hooks not updating doc
body: <p>I'm using the great aldeed:autoform package for MeteorJS. I've got a custom form that lets me create db entries. </p>
  
  <p>One of the user-entered form fields is for Suburb and I'm using the sergeyt:typeahead package to make suggestions on this as the user types. </p>
  
  <p>The suggestions are in a format that's familiar to users (essentially it's "suburb, STATE, zipcode"). I call this longsuburb. </p>
  
  <p>I'm then using the AutoForm before hook to split out a Zipcode ("postcode") value and a "suburb" value from the user selected/entered longsuburb value. The hook then inserts the suburb and postcode values into the doc before it's submitted.</p>
  
  <p>This is all working great.</p>
  
  <p>Now I want to create an Edit form where a user can edit the details (down the line I plan to use the same form for both, but it's one step at a time for me as I'm a novice).</p>
  
  <p>I've set up an Edit form template and have set the type to "update" as per the AutoForm examples. </p>
  
  <p>I can successfully edit all of the form details and they save to the collection, except that my AutoForm hook doesn't seem to get called at all so the "suburb" and "postcode" values for the doc are staying the same on submit.</p>
  
  <p>I've tried a few different approaches but am largely shooting in the dark so any advice would be great.</p>
  
  <p>Here's the Edit Form template</p>
  
  <pre><code>    &lt;template name="editBar"&gt;
    {{#autoForm collection="Bars" id="editBarsForm" template="bootstrap3-horizontal" label-class="col-sm-3" input-col-class="col-sm-9" type="update" doc=this}}
    &lt;fieldset&gt;
      &lt;legend&gt;Edit Bar&lt;/legend&gt;
      {{&gt; afQuickField name='bar_name' placeholder="Name of the Bar, Pub, Venue" class="form-control typeahead" }}
      {{&gt; afQuickField name='image' class="form-control typeahead" }}
      {{&gt; afQuickField name='url' placeholder="Venue's Website" class="form-control typeahead" }}
      {{&gt; afQuickField name='longsuburb' placeholder="Suburb" class="form-control typeahead" autocomplete="off" spellcheck="off" data-source="getSuburbs"}}
      {{&gt; afQuickField name='barType' options=bartypes class="selectpicker"}}
    &lt;/fieldset&gt;
    &lt;button type="submit" class="btn btn-primary submit"&gt;Submit&lt;/button&gt;
      &lt;a class="btn btn-danger delete" href="#"&gt;Delete post&lt;/a&gt;
      &lt;a class="btn btn-default cancel" href="#"&gt;Cancel&lt;/a&gt;
    {{/autoForm}}
  &lt;/template&gt;
  </code></pre>
  
  <p>And here's what I have in the Edit Form JS file</p>
  
  <pre><code>      Template.editBar.helpers({
    getSuburbs: function() {
      return AuPostcodes.find().fetch().map(function(it){ return it.longsuburb;     });
      console.log('it');
    },
  
    bartypes: function() {
      return [
        {label: "Select", value: ""},
        {label: "Bar", value: "bar"},
        {label: "Pub", value: "pub"}
      ];
    }
  
  });
  
  
  
    Template.editBar.rendered = function(){
      Meteor.typeahead.inject();
    };
  
  
    //Split out suburb and postcide from form's longsuburb string and submit with doc to Bars collection.
    //"suburb" currently used for filtering.
  
    AutoForm.hooks({
        editBarsForm: {
            before:{
              insert: function(doc) {
                var suburbString = doc.longsuburb;
                var postcode = suburbString.substring(suburbString.lastIndexOf(",")+2,suburbString.length);
                var suburb = suburbString.substring(0,suburbString.indexOf(","));
                doc.postcode = postcode;
                doc.suburb = suburb;
                return doc; //autoFrom magic commence
                }
              }
            }
          });
  
  Template.editBar.events({
    'click .delete': function(e) {
      e.preventDefault();
  
      if (confirm("Delete this bar?")) {
        var currentBarId = this._id;
        Bars.remove(currentBarId);
        Router.go('barsList');
      }
    },
    'click .cancel': function(e) {
      e.preventDefault();
      Router.go('barsList');
    }
  });
  </code></pre>
  
  <p>The add template and code are largely the same. As I say all works well for Creating a record. I can also edit name, url, longsuburb etc and they are saved to the DB. It's just the doc insert that's not working.</p>