0

I am trying to handle the selection of a tradingPair by using a view model helper that will call the function the pair should be sent to: select(). It is only returning object Object...
Why isn't Blaze/Meteor correctly passing this value to my helper function?

  //HTML
  <select class="select-pair-drop" id="pairOptions" {{b "change: handleChange"}}> 
          {{#each tradingPairs}}
            <option value={{this}} name="pairOption">
              <span class="base">{{this.base}}</span> / <span class="quote">{{this.quote}}</span>
            </option>
          {{/each}}
   </select>

  // JS in a Template.<name>.viewmodel()
  handleChange(event) {
   event.preventDefault();
   const choice = (event.target.value);
   console.log(choice);
   this.select(choice);
  }

The issue is, my console.log only returns object Object and the object is seemingly being passed through wrong. Can anyone help me here? I have been struggling on this for awhile - please let me know if I can provide more clarity or information.

Reza Rahemtola
  • 1,182
  • 7
  • 16
  • 30
  • Does this answer your question? [Get selected value in dropdown list using JavaScript](https://stackoverflow.com/questions/1085801/get-selected-value-in-dropdown-list-using-javascript) – coagmano Sep 20 '20 at 22:06
  • If you want to see [object Object] then use console.log(JSON.stringify(choice)) – mwarren Oct 07 '20 at 13:30

0 Answers0