I have the following HTML:
<button class='jqui_btn' id='background_image_fileSelect' data-
bind='click: function(){}'>Choose Background Image</button>
<input data-bind='value: common_items.background_image'
disabled='disabled' />
I have a Widget which adds a <input type="file"/> element. Then when
the button is clicked the standard OS File|Open dialog is opened.
After the user selects a file I need to determine the viewmodel item
associated with the <input> element shown above so I can set it to the
chosen filename.
If have tried various ways the get the viewmodel item without success.
I would have thought that:
var data_bind = input_val.data('bind');
would work, however it returns undefined. input_val is the <input>
element shown above.
Note that there are quite a few of these <input type="file"/> elements
so I need a solution to handle them all in a general way.
Any help appreciated.
---
Neville
http://www.surfulater.com