drwkqwa82140 2012-03-24 10:18 采纳率: 0%
浏览 40

根据下拉框选择显示动态文本

I am using Dreamweaver to create a site. I have created my database within phpMyAdmin and have two tables set up that contain the data I wish to display on my site. (it is a football team site and the page I am editing displays player profiles).

I have set up a drop down box, which is connected to my players table in phpMyAdmin. This I have set to display surname of the player. (I've set up the recordset to retrieve all data from my "players" table) Below that, I have another div which contains text that I want to display based on the selection on the drop down list. For example, Position, appearances, goals, assists, etc.

Position: Dynamic text to be displayed here Appearances: Dynamic text to be displayed here etc (This data would come from the "players_info" table - but the two tables are connected via the player_id field which is contained in both)

What I can't seem to do is work out how to get the text to update when the user would select a player from the drop down list.

Any help would be greatly appreciated.

Thanks James

  • 写回答

1条回答 默认 最新

  • drygauost253590142 2012-03-24 10:47
    关注

    You can do these using ajax function. when you select a player name ,then javascript or jquery event will be called which include a php file. This php file must contain the sql which fetch your desired player information. when server give response, then display it your corresponding div

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向