duanlu5055 2019-02-07 04:10
浏览 67

使用带有CodeIgniter的AJAX Live Search

In CodeIgniter I have a form for vacation time, and I need to select what user I am assigning the vacation time for. I need help with the following 2 things

  1. I need to use AJAX to search for the user and display them under the search bar as you are typing.

  2. Once you click on the one you want, add them to a variable and remember just the user_id, so when I submit my form I can send the user_id, To_Date and From_Date.

Below are some pictures to help explain what I need. If someone could point me to a tutorial or some information on using AJAX this way I would appreciate it.

User Form
User form

AJAX Search
AJAX search

  • 写回答

1条回答 默认 最新

  • dongyou9818 2019-02-07 22:56
    关注

    Your approach to achieve this with <select> is wrong. Use <input type="text"> to make ajax call. If still want to make it happen a simple solution with <select> will be to load all your employees in <option> and use select2 js library.

    评论

报告相同问题?

悬赏问题

  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法