Hello,
I am using the jquery ui autocomplete plugin on dataInit – it works – but the problem is that when user select an item, the value of the datasource is set to the input field and not the label.
What would like is to set the input filed to label and post the value parameter – Is there anyway to achieve this
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
var countries = [ {label: "United States", value: "US"}, {label: "Canada", value: "CA"}, {label: "Mexico", value: "MX"}, {label: "Brazil", value: "BR"} ]; dataInit:function(el){ $(el).autocomplete({ source:countries, minLength: 2, autoFocus:true, select:function(event,ui){ $(el).val(ui.item.label); } }); |
I can set label using the select event but need somehow post the value
Thanks,
Kris
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top