使用bootstrap typehead进行自动完成。在打印头文档的帮助下,自动完成工作正常,但是当我从自动完成中选择特定值时,我需要在标签字段中获取相关名称。
这是我的HTML代码。
<input type="text" class="ipt_Field" id="txt_schName" name="txt_schName" />
<label id="school_Name"></label>
这是我的json数据
["COL000001,Emirates College of Technology- UAE","COL000002,Al Khawarizmi International College- UAE","COL000003,Syscoms College","COL000004,Abounajm Khanj Pre-Uni Center","COL000005,Advanced Placement","COL000006,Al Buraimi College (Uni Clge)","COL000007,Al-Ain Community College","COL000008,AMA Computer College","COL000009,Arab Academy for Bankg and Fin","COL0000010,ARABACDSCITECHMARTIMETRNS","COL0000011,Arapahoe Community College"]
这是我的jquery代码
$("#txt_schName").typeahead({
name: 'School Name',
// data source
prefetch: 'json/school_name.json',
// max item numbers list in the dropdown
limit: 5,
minLength:3
});
请指导我如何获得相应的标签vaule。我很挣扎。
谢谢&amp;问候 马哈德