Vue-select: send value to hidden inputbox

Created on 13 Sep 2018  Â·  5Comments  Â·  Source: sagalbot/vue-select

Hi, im trying to send a selected option into an hidden input box but i get [object object] in return
i tried this solution : https://github.com/sagalbot/vue-select/issues/495 but it did not work

  <v-select v-tooltip.right="msg"  taggable max-height="100px" ref="jobbox" push-tags v-model="selected" dir="rtl" label="alljobstitle" name="selected"  :options="alljobsnew" >
</v-select> 
  <input type="hidden" name="selectedItem" :value="selected">

Laravel output

array:3 [â–¼
  "_token" => "FJ1m43y3Mm5CgwL2Q8meX1HTycMxTKCc9gl"
  "selectedItem" => "[object Object]"
  "ment" => "0"
]

i did try v-model still the same output, im stuck and out of time
thanks for any help!

Most helpful comment

Hmm.. I'm taking a short in the dark here but maybe try converting the object into a string?

<v-select v-model="selected" />
<input type="hidden" :value="JSON.stringify(selected)" />

All 5 comments

Hmm.. I'm taking a short in the dark here but maybe try converting the object into a string?

<v-select v-model="selected" />
<input type="hidden" :value="JSON.stringify(selected)" />

Thanks dude u are a awsome

Glad it worked!

not worked selected still same

@prasetyo-jeanu please stop commenting on multiple issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xuwenhao picture xuwenhao  Â·  3Comments

threeaccents picture threeaccents  Â·  3Comments

twz915 picture twz915  Â·  3Comments

edalzell picture edalzell  Â·  3Comments

lau-a picture lau-a  Â·  3Comments