我有以下文本字段 -
<input type="text" name="id" id="id" tabindex="1">
<input type="text" name="name" id="name" tabindex="1"/>
mysql数据库的截图是-
id name
123 John
124 Rahi
当我在第一个文本字段中插入轨道 ID 时,相应的学生姓名应显示在第二个字段中。如何使用 ajax 来完成?
最佳答案
试试这个:
>> Trigger onblur event (javascript function) for the first textbox.
>> Define ajax in that function to get name.
>> Show the name in textbox.
I think this is simplest way to get this.
-- 谢谢
关于php - 使用ajax从mysql数据库检索并打印数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22551480/