title: pass Algolia id attribute instead of Name Atributre in a post request on Laravel 5.2
body: <p>Using the Javascript, Vue.js and Typeahead.js way shown by Jeffery Way and Algolia docs to index json objects from the Algolia platform.</p>
  
  <p>Currently when i search for the result i require and hit the submit button, It is passing the name attribute through in the post request.</p>
  
  <p>How is it possible to pass the name and the id attribute or if nescessery just the ID arrtibute would work.</p>
  
  <pre><code>&lt;script&gt;
  new Vue({
      el: 'body', 
      data: {     
      query: '',
      users: []       
      },  
  ready: function(){
  this.client = algoliasearch("MYID", "MYAPI");
  this.index = this.client.initIndex('dev_category_list');
  $('#typeahead').typeahead(null, {   
      source: this.index.ttAdapter(),
      displayKey: 'name'
  });
  },
    methods: {
      search: function(){
          if (this.query.length &lt; 3) return;
      this.index.search(this.query, function(error, results){
      this.users = results.hits;
      }.bind(this));
      }     
  }  
  })
  &lt;/script&gt;
  </code></pre>
  
  <p>As a total newcomer the laravel, vuejs and javascript its somewhat difficult to get to grips with the syntax and phrases used when explaining the instructons within the docs so any help would be greatly appreciated.</p>
  
  <p>My indexed objects look like so:</p>
  
  <pre><code>{
    "id": "3",
    "name": "My Product 3",
    "value": "3",
    "alternative_name": "Prod 3",
    "objectID": "3"
  }
  </code></pre>
  
  <p>Im hoping to pass the value of ID or objectID along with the name attribute in a post request once the user selects the given result from the algolia drop down menu and hits the submit, just the ID would work as mentioned above if its not possible.</p>
  
  <p>Thanks.</p>
  
  <hr>
  
  <p><strong>--- Update referencing Jerska: ---</strong></p>
  
  <p>Ok so after playing around as a newbie for a little bit i seem to have it working, Im not exactly sure how secure this is or how reliable one would say, Hopefully im not a million miles off from where i need to be. Be good to see what your personal and professional thoughts are.</p>
  
  <pre><code>.on('typeahead:select', function (e, suggestion) {
     $('#typeahead').change(function() {
      var val = suggestion.id;
      $('#st').val(val);
  });
  </code></pre>
  
  <p>I have created a hidden input field and named is 'st' for a demo and on update of the algolia results jquery is using the .change function to append the value to the hidden input fields value. That way the form can be continued and sibmitted as i originally wanted and hoped for, The benefit here is that even if the user is to select a result from algoia drop down menu then continue with the form, If he or she decides they want to go back to the search field and change it, They can do before they submit the form or before any window.location is run, I even thought of using ajax or simply jquery $.post but its working ok the .change</p>
  
  <p>Look forward to hearing your thoughts.
  Thanks</p>