简体   繁体   中英

Select tag in html form

I want send <form> from client, and one of fields in the <form> is <select> .
I am using knockout data binding.

<form method="get" action="http://google.com/" target="_blank">
    <input data-bind="text: name" name="meow">
    <select name="dog" data-bind="options: objects, 
                                  optionsText: function(item){return item.secid},
                                  optionsValue : $data.id">
    </select>
    <input type='submit'>
</form>  

But value from select is always empty in request. Any ideas?
JSFiddle is here

function(item){return item.id}替换$data.id function(item){return item.id}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM