weixin_33713707 2012-06-07 07:54 采纳率: 0%
浏览 24

部分Web表单请求,AJAX

I'm not sure how to ask this.

I have a HTML form that has several fields, including user id, which maps to a real name. I have jQuery validation of the form working.

Right now, I have to submit the POST request, to show the user's real name.

example: It should show "john doe" if the user types "3", before without clicking submit.

ID input: [3] ( john doe )

Do I use jQuery to retrieve this information? Do I also set up a new page, that has a response to a POST request, that returns 'john doe' as XML / JSON or something along those lines?

note: Using python's Flask. Maybe I should use Flask-Sijax ?

  • 写回答

1条回答 默认 最新

  • weixin_33711647 2012-06-09 01:40
    关注

    The Flask documentation has a good example using jquery to fetch a value from the server without posting the whole page.

    If you wanted it to fire as a user types the number (rather then hitting a button in the example) you could use the .keyup event in jQuery instead of the .bind/click event shown the example.

    评论

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建