我在我的表單中使用自動完成插件。我正在使用這個自動完成功能的一個div,這是由AJAX生成的文本框,無論如何自動完成功能工作正常...我需要您的建議後,從textfield中選擇一個自動填充的數據,我需要運行一個JavaScript函數所選數據填寫在同一個div的其他列中。因此,對於這一點,我想,我需要自動完成數據選擇後,只需編寫一個函數.. 我將如何做事先做人這個.... 感謝名單.....jquery幫助需要
-3
A
回答
1
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("waitimg").innerHTML="";
document.getElementById("ajxform").innerHTML=xmlhttp.responseText;
$(function(){ $("#item_no").autocomplete("auto/finditem.cfm"); })
}
}
<div id="divid">
<input type="text" name="item_no" id="item_no">
<input type="text" >
</div>
如此成功的人口通過上面的Ajax調用的div,我使用自動完成...
1
假設你使用這個插件,如果另一個插件的 http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ ,莫比你需要一個不同的事件,但:
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("waitimg").innerHTML="";
document.getElementById("ajxform").innerHTML=xmlhttp.responseText;
$(function(){
$("#item_no").autocomplete("auto/finditem.cfm").result(function(event, data, formatted){
$("#idOfOtherInput").html(formatted);
});
})
}
沒有測試過,在此基礎上例如 http://docs.jquery.com/Plugins/Autocomplete/result#handler
1
如果您正在使用jQuery的從自動完成的小部件,那麼你可以使用像建設「中選擇」屬性:
$("#textid").autocomplete({select: function(event, ui)
{
// put your code here to write the value into another control
// for this use ui.item.value and ui.item.id
}
相關問題
- 1. JQUERY需要幫助!
- 2. jquery幫助需要
- 3. 需要幫助jQuery
- 4. 需要幫助調試JQuery
- 5. 需要幫助jQuery驗證
- 6. 需要幫助jQuery動畫
- 7. 需要Jquery/Ajax/HTML幫助
- 8. jquery ajax php需要幫助
- 9. 需要幫助jquery排序
- 10. 需要JQuery和Ajax幫助
- 11. Javascript/jQuery ajax幫助需要
- 12. 需要幫助
- 13. 需要幫助
- 14. cssSandpaper.js幫助需要?
- 15. 需要ActionListener幫助!
- 16. 需要MySQL幫助
- 17. 需要Java幫助
- 18. 需要幫助JAVA
- 19. 需要幫助UIText
- 20. RAZOR需要幫助
- 21. LINQTOSQL需要幫助
- 22. 需要幫助InstallShield
- 23. 需要onclick幫助
- 24. Javascript:setTimeout() - 需要幫助
- 25. HttpWebrequest需要幫助
- 26. 需要幫助TCHart
- 27. SimpleXML幫助需要
- 28. 需要幫助Ordereddict
- 29. 需要Hibernate幫助
- 30. 需要EJB幫助
這將是一個好主意,如果你顯示你已經擁有的代碼。 – 2010-08-12 12:16:31
是的,你可能會閱讀www.jquery.com上的文檔。一切都在那裏解釋! – 2010-08-12 12:21:20